Detect change in property within control

S

Stanley Glass

Is it possble to have a property like so:
Code:
<Bindable(True), Category("Appearance"), Description("The help image
associated with this control."),
Editor(GetType(System.Web.UI.Design.ImageUrlEditor),
GetType(System.Drawing.Design.UITypeEditor))> _
Public Property HelpImage() As String
Get
Return imgURL
End Get

Set(ByVal Value As String)
imgURL = Value
End Set
End Property

And then be able to detect if the developer has changed it? So that it could
say change the visibility of another control within this same control?
Code:
<Bindable(True), Category("Appearance"), Description("The help image
associated with this control."),
Editor(GetType(System.Web.UI.Design.ImageUrlEditor),
GetType(System.Drawing.Design.UITypeEditor))> _
Public Property HelpImage() As String
Get
Return imgURL
End Get

Set(ByVal Value As String)
imgURL = Value
if Value <> "" then
imgButton.Visible = True
else
imgButton.Visible = False
end if
End Set
End Property

-Stanley
 
A

Alessandro Zifiglio

If Value Is Nothing Or Value.Length = 0 Then
imgButton.Visible = True
else
imgButton.Visible = False
End If
This is a perfectly correct way to take action if the property has not been
supplied --havent you tested this to work already ? ;P
I actually dont see anything wrong with your code --what is not working ? :S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top