Subscribing

  • Thread starter Thread starter Amer Kheir via .NET 247
  • Start date Start date
A

Amer Kheir via .NET 247

Salaam Everybody,
I created a custom Control using vb.net.
this Control has a Logo Property which gets and sets the logo of my control. this logo is actually an image.
here is my code:
 
You have to create an "associated" method having the name "Reset"+
"<TheNameOfTheProperty>" :

protected void ResetLogo()
{
this.m_imgLogo=null;
}

Ernest


Amer Kheir ia .NET 247 said:
Salaam Everybody,
I created a custom Control using vb.net.
this Control has a Logo Property which gets and sets the logo of my
control. this logo is actually an image.
here is my code:
.
.
private m_imgLogo as Image
.
.
public Property Logo() as Image
Get
return m_imgLogo
End Get
Set (Value as Image)
m_imgLogo = Value
End Set
End Property

and this works ok; it lets you select an image, but my problem is: after
selecting an image, It doesn't let you delete your selection and go back to
{(none)} value.
 
Easier to use the DefaultValue attribute
<System.ComponentModel.DefaultValue(GetType(Image), "Nothing")>

/claes

Ernest Morariu said:
You have to create an "associated" method having the name "Reset"+
"<TheNameOfTheProperty>" :

protected void ResetLogo()
{
this.m_imgLogo=null;
}

Ernest


Amer Kheir ia .NET 247 said:
Salaam Everybody,
I created a custom Control using vb.net.
this Control has a Logo Property which gets and sets the logo of my
control. this logo is actually an image.
here is my code:
.
.
private m_imgLogo as Image
.
.
public Property Logo() as Image
Get
return m_imgLogo
End Get
Set (Value as Image)
m_imgLogo = Value
End Set
End Property

and this works ok; it lets you select an image, but my problem is: after
selecting an image, It doesn't let you delete your selection and go back to
{(none)} value.
 
Back
Top