473,699 Members | 2,236 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_intLineThickn ess
End Get
Set(ByVal Value As Integer)
m_intLineThickn ess = 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 1416
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_intLineThickn ess
End Get
Set(ByVal Value As Integer)
m_intLineThickn ess = 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_intLineThickn ess
End Get
Set(ByVal Value As Integer)
m_intLineThickn ess = 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
1928
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 button that prevents the user from submitting a form back multiple times and also prevents them from submitting the form and then clicking something else before the postback can finish processing. What I have is a working button that disables...
6
11180
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 textboxes, Textbox1 and Textbox2, and add a databinding to Textbox2 as such: Textbox2.Databindings.Add("Text",Textbox1,"Text") Anything typed into Textbox1 is mirrored in Textbox2.
4
288
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) m_DashStyle = Value End Set
19
4910
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 exception of custom Collection Classes. Background: I'm developing an A2K .mdb to be deployed as an .mde at my current job-site. It has several custom controls which utilize custom classes to wrap built-in controls, and add additional functionality....
1
3226
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' & 'Cancel'). Till this point, no problem. Initially, the TextBox is empty. The Button has a property named 'ConfirmMessage' so that the developer using this custom control can modify the question in the confirm dialog. If the user clicks 'OK', I want the...
3
4758
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
3896
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 lines of code from the GetGeometry method within the CustomPolyLine class: _points.Add(new Point(10, 10));
2
19474
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 will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's words, or maybe, my own words as how I understand them, hoping, you will understand it the same way that...
0
2897
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 will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's words, or maybe, my own words as how I understand them, hoping, you will understand it the same way that...
0
8689
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9178
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9035
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8916
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8885
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4376
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.