473,513 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PropertyChanged event with VB.NET (.NET 1.1)

Hi.

I searched for hours now but can't find how to get the following to work:

A usercontrol with two properties (A and B).
If A is changed in the designer, B should be changed as well.
This works but the change in B is not instantly reflected in the
designer, it's only shown if you click on B and then the new value is shown.

In VB6 this works by calling PropertyChanged "B".
In VB.NET 2.0 this also works using some INotifyPropertyChanged thing.
But how does it work with VB.NET 1.1?

I even wrote a VB6 app (where everything worked) and then used the
upgrade manager from VB.NET to convert the project. It renamed the
events but the changes are not reflected in the designer as it did in VB6.

The only thing remotely helpful I found is this page
http://www.interact-sw.co.uk/iangblo...propertychange
which seems a bit too complicated for such an easy(?) problem.

Public Class UC
Inherits System.Windows.Forms.UserControl

Private m_A as integer
Private m_B as integer

Public Property A As Integer
Get
Return m_A
End Get
Set(ByVal Value As Integer)
m_A = Value
m_B = m_A
End Set
End Property

Public Property B As Integer
Get
Return m_B
End Get
Set(ByVal Value As Integer)
m_B = Value
End Set
End Property

end class

Any help would be greatly appreciated
Mark
Feb 19 '06 #1
5 5260
Use the RefreshProperties attribute
http://msdn.microsoft.com/library/de...ClassTopic.asp

"Mark" <ne**@eggenstein.net> wrote in message
news:eY**************@TK2MSFTNGP10.phx.gbl...
Hi.

I searched for hours now but can't find how to get the following to work:

A usercontrol with two properties (A and B).
If A is changed in the designer, B should be changed as well.
This works but the change in B is not instantly reflected in the designer,
it's only shown if you click on B and then the new value is shown.

In VB6 this works by calling PropertyChanged "B".
In VB.NET 2.0 this also works using some INotifyPropertyChanged thing.
But how does it work with VB.NET 1.1?

I even wrote a VB6 app (where everything worked) and then used the upgrade
manager from VB.NET to convert the project. It renamed the events but the
changes are not reflected in the designer as it did in VB6.

The only thing remotely helpful I found is this page
http://www.interact-sw.co.uk/iangblo...propertychange
which seems a bit too complicated for such an easy(?) problem.

Public Class UC
Inherits System.Windows.Forms.UserControl

Private m_A as integer
Private m_B as integer

Public Property A As Integer
Get
Return m_A
End Get
Set(ByVal Value As Integer)
m_A = Value
m_B = m_A
End Set
End Property

Public Property B As Integer
Get
Return m_B
End Get
Set(ByVal Value As Integer)
m_B = Value
End Set
End Property

end class

Any help would be greatly appreciated
Mark

Feb 20 '06 #2
Do you have an example using the RefreshProperties Attribute? Sounds like
what I'm looking for in my usercontrol. Thanks for any help.
--
Dennis in Houston
"Rocky" wrote:
Use the RefreshProperties attribute
http://msdn.microsoft.com/library/de...ClassTopic.asp

"Mark" <ne**@eggenstein.net> wrote in message
news:eY**************@TK2MSFTNGP10.phx.gbl...
Hi.

I searched for hours now but can't find how to get the following to work:

A usercontrol with two properties (A and B).
If A is changed in the designer, B should be changed as well.
This works but the change in B is not instantly reflected in the designer,
it's only shown if you click on B and then the new value is shown.

In VB6 this works by calling PropertyChanged "B".
In VB.NET 2.0 this also works using some INotifyPropertyChanged thing.
But how does it work with VB.NET 1.1?

I even wrote a VB6 app (where everything worked) and then used the upgrade
manager from VB.NET to convert the project. It renamed the events but the
changes are not reflected in the designer as it did in VB6.

The only thing remotely helpful I found is this page
http://www.interact-sw.co.uk/iangblo...propertychange
which seems a bit too complicated for such an easy(?) problem.

Public Class UC
Inherits System.Windows.Forms.UserControl

Private m_A as integer
Private m_B as integer

Public Property A As Integer
Get
Return m_A
End Get
Set(ByVal Value As Integer)
m_A = Value
m_B = m_A
End Set
End Property

Public Property B As Integer
Get
Return m_B
End Get
Set(ByVal Value As Integer)
m_B = Value
End Set
End Property

end class

Any help would be greatly appreciated
Mark


Feb 21 '06 #3
Imports System.ComponentModel

<RefreshProperties(RefreshProperties.All)> _
Public Property Enabled() As Boolean
Get
Return isEnabled
End Get
Set(ByVal Value As Boolean)
isEnabled = Value
End Set
End Property

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:78**********************************@microsof t.com...
Do you have an example using the RefreshProperties Attribute? Sounds like
what I'm looking for in my usercontrol. Thanks for any help.
--
Dennis in Houston
"Rocky" wrote:
Use the RefreshProperties attribute
http://msdn.microsoft.com/library/de...ClassTopic.asp

"Mark" <ne**@eggenstein.net> wrote in message
news:eY**************@TK2MSFTNGP10.phx.gbl...
> Hi.
>
> I searched for hours now but can't find how to get the following to
> work:
>
> A usercontrol with two properties (A and B).
> If A is changed in the designer, B should be changed as well.
> This works but the change in B is not instantly reflected in the
> designer,
> it's only shown if you click on B and then the new value is shown.
>
> In VB6 this works by calling PropertyChanged "B".
> In VB.NET 2.0 this also works using some INotifyPropertyChanged thing.
> But how does it work with VB.NET 1.1?
>
> I even wrote a VB6 app (where everything worked) and then used the
> upgrade
> manager from VB.NET to convert the project. It renamed the events but
> the
> changes are not reflected in the designer as it did in VB6.
>
> The only thing remotely helpful I found is this page
> http://www.interact-sw.co.uk/iangblo...propertychange
> which seems a bit too complicated for such an easy(?) problem.
>
> Public Class UC
> Inherits System.Windows.Forms.UserControl
>
> Private m_A as integer
> Private m_B as integer
>
> Public Property A As Integer
> Get
> Return m_A
> End Get
> Set(ByVal Value As Integer)
> m_A = Value
> m_B = m_A
> End Set
> End Property
>
> Public Property B As Integer
> Get
> Return m_B
> End Get
> Set(ByVal Value As Integer)
> m_B = Value
> End Set
> End Property
>
> end class
>
> Any help would be greatly appreciated
> Mark


Feb 21 '06 #4
Rocky wrote:
<RefreshProperties(RefreshProperties.All)> _
Public Property Enabled() As Boolean


I tried the RefreshProperties in front of the class definition and it
still did not work. Thanks for giving this easy example, that gave me
the important hint to use it directly with property.

Mark
Feb 21 '06 #5
Grrrrrrrrreat..thanks for the code..I've put it in my examples.
--
Dennis in Houston
"Rocky" wrote:
Imports System.ComponentModel

<RefreshProperties(RefreshProperties.All)> _
Public Property Enabled() As Boolean
Get
Return isEnabled
End Get
Set(ByVal Value As Boolean)
isEnabled = Value
End Set
End Property

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:78**********************************@microsof t.com...
Do you have an example using the RefreshProperties Attribute? Sounds like
what I'm looking for in my usercontrol. Thanks for any help.
--
Dennis in Houston
"Rocky" wrote:
Use the RefreshProperties attribute
http://msdn.microsoft.com/library/de...ClassTopic.asp

"Mark" <ne**@eggenstein.net> wrote in message
news:eY**************@TK2MSFTNGP10.phx.gbl...
> Hi.
>
> I searched for hours now but can't find how to get the following to
> work:
>
> A usercontrol with two properties (A and B).
> If A is changed in the designer, B should be changed as well.
> This works but the change in B is not instantly reflected in the
> designer,
> it's only shown if you click on B and then the new value is shown.
>
> In VB6 this works by calling PropertyChanged "B".
> In VB.NET 2.0 this also works using some INotifyPropertyChanged thing.
> But how does it work with VB.NET 1.1?
>
> I even wrote a VB6 app (where everything worked) and then used the
> upgrade
> manager from VB.NET to convert the project. It renamed the events but
> the
> changes are not reflected in the designer as it did in VB6.
>
> The only thing remotely helpful I found is this page
> http://www.interact-sw.co.uk/iangblo...propertychange
> which seems a bit too complicated for such an easy(?) problem.
>
> Public Class UC
> Inherits System.Windows.Forms.UserControl
>
> Private m_A as integer
> Private m_B as integer
>
> Public Property A As Integer
> Get
> Return m_A
> End Get
> Set(ByVal Value As Integer)
> m_A = Value
> m_B = m_A
> End Set
> End Property
>
> Public Property B As Integer
> Get
> Return m_B
> End Get
> Set(ByVal Value As Integer)
> m_B = Value
> End Set
> End Property
>
> end class
>
> Any help would be greatly appreciated
> Mark


Feb 22 '06 #6

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

Similar topics

0
7008
by: Andy Read | last post by:
Hello all, I have the requirement to produce source code that produces an object hierarchy. Example: Root | Folder 1
18
2852
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
8
6076
by: Mark | last post by:
Hi, I'm looking for some ideas on how to build a very simple Event processing framework in my C++ app. Here is a quick background ... I'm building a multithreaded app in C++ (on Linux) that...
3
10380
by: John Baro | last post by:
I need to implement an event to notify when a property has changed. Method 1. If I use a generic PropertyChanged event from System.ComponentModel then it will be raised for every property if 1...
13
3479
by: Charles Law | last post by:
Mr "yEaH rIgHt" posted the following link about a week ago in answer to my question about removing event handlers. > http://www.vbinfozine.com/t_bindevt.shtml Following on from that post, the...
12
4103
by: Jack Russell | last post by:
My unstanding of all VB up to and including vb6 is that an event could not "interrupt" itself. For instance if you had a timer event containing a msgbox then you would only get one message. ...
41
4242
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
9
2456
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the...
2
7191
by: Dinsdale | last post by:
We have created a object library that implements the INotifyPropertyChanged.PropertyChanged to bubble changes up to higher level classes. For instance, we have a person class that can have...
0
7267
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
7391
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,...
1
7120
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...
1
5100
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...
0
4754
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1609
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 ...
1
809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
466
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...

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.