473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Responding to custom property changes.

I have implemented DashStyle and LineThickness for custom circle control as
follows:

Public Property DashStyle() As DashStyle
Get
Return m_DashStyle
End Get
Set(ByVal Value As DashStyle)
m_DashStyle = Value
End Set
End Property

<DefaultValue(1)> _
Public Property LineThickness() As Integer
Get
Return m_intLineThickness
End Get
Set(ByVal Value As Integer)
m_intLineThickness = Value
End Set
End Property

Now how can I make changes to these property take effect at design and run
time.

At design time any changes to these two property doesn’t take effect. The
circle remains same at design time.

Jul 21 '05 #1
4 1393
How do you draw the circle? If you do it in Paint event then you could trigger
it by calling Invalidate() method after the property changes, i.e.
....
Set(ByVal Value As DashStyle)
m_DashStyle = Value
Invalidate()
End Set
I have implemented DashStyle and LineThickness for custom circle
control as follows:

Public Property DashStyle() As DashStyle
Get
Return m_DashStyle
End Get
Set(ByVal Value As DashStyle)
m_DashStyle = Value
End Set
End Property
<DefaultValue(1)> _
Public Property LineThickness() As Integer
Get
Return m_intLineThickness
End Get
Set(ByVal Value As Integer)
m_intLineThickness = Value
End Set
End Property
Now how can I make changes to these property take effect at design and
run time.

At design time any changes to these two property doesn't take effect.
The circle remains same at design time.



Jul 21 '05 #2
Thanks Alexander.

Someone suggested me using Refresh() method after property changes. Does
refresh works differently from invalidate()?

"Alexander Shirshov" wrote:
How do you draw the circle? If you do it in Paint event then you could trigger
it by calling Invalidate() method after the property changes, i.e.
....
Set(ByVal Value As DashStyle)
m_DashStyle = Value
Invalidate()
End Set
I have implemented DashStyle and LineThickness for custom circle
control as follows:

Public Property DashStyle() As DashStyle
Get
Return m_DashStyle
End Get
Set(ByVal Value As DashStyle)
m_DashStyle = Value
End Set
End Property
<DefaultValue(1)> _
Public Property LineThickness() As Integer
Get
Return m_intLineThickness
End Get
Set(ByVal Value As Integer)
m_intLineThickness = Value
End Set
End Property
Now how can I make changes to these property take effect at design and
run time.

At design time any changes to these two property doesn't take effect.
The circle remains same at design time.



Jul 21 '05 #3
> Thanks Alexander.

Someone suggested me using Refresh() method after property changes.
Does refresh works differently from invalidate()?


This is what Refresh does:

public virtual void Refresh()
{
this.Invalidate(true);
this.Update();
}

It marks the control as invalid and then forces the redraw, while just calling
Invalidate() "enqeues" the redraw.

I guess there's no real difference in your case.

Alexander
Jul 21 '05 #4
Thanks

"Alexander Shirshov" wrote:
Thanks Alexander.

Someone suggested me using Refresh() method after property changes.
Does refresh works differently from invalidate()?


This is what Refresh does:

public virtual void Refresh()
{
this.Invalidate(true);
this.Update();
}

It marks the control as invalid and then forces the redraw, while just calling
Invalidate() "enqeues" the redraw.

I guess there's no real difference in your case.

Alexander

Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sundown | last post by:
I am trying to create a custom button control for the web that, when clicked, disables and changes the text of itself and a bunch of other controls (in the collection). My goal is to end up with a...
6
by: Scott Mueller | last post by:
I have a question about simple binding: (please forgive any syntax errors... I am at home, where I do not have Vb.Net installed, and I rely far too much on Vb's intellisense!) If I have two...
4
by: Job Lot | last post by:
I have implemented DashStyle and LineThickness for custom circle control as follows: Public Property DashStyle() As DashStyle Get Return m_DashStyle End Get Set(ByVal Value As DashStyle)...
19
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the...
1
by: rn5a | last post by:
I want to create a custom control that encapsulates a Button & a TextBox. When the Button is clicked, the user is asked a question using JavaScript confirm (which shows 2 buttons - 'OK' &...
3
by: R.A.F. | last post by:
Hi, I have a custom control in which i have a property based on CollectionBase class. like the following one : //------- XGrid.cs file --------------// public ColumnsCollection Columns {
4
by: Linda Liu[MSFT] | last post by:
Hi Moondaddy, I downloaded your sample project and run it and did see the problem on my side. There're three problems in the source code of your project. 1. You should move the following...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.