By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,592 Members | 1,569 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,592 IT Pros & Developers. It's quick & easy.

PropertyChanged event with VB.NET (.NET 1.1)

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.