Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have defined a propertygrid calling standard system colour resources. The problem is that I can't figure out how to make the propertygrid on runtime to select the colour red, I have tried entering the following into the defaultvalueattribute on the propertygrid.

 

See code below:

 

    
  Private _colour As System.Drawing.Color
  <CategoryAttribute("Colour"), _
   DefaultValueAttribute("Red"), _
   DescriptionAttribute("Select a colour")> _
   Public Property Colour() As System.Drawing.Color
       Get
           Return _colour
       End Get
       Set(ByVal Value As System.Drawing.Color)
           _color = Value
       End Set
   End Property

 

The problem is that it just runs the code and the colour property just keeps saying None.

 

Any ideas?

 

Cheers

 

Simon

Posted
Exactly the same - just declare a variable / property of type font and assign a font to the variable.

 

The issue that I have got is that I am not sure exsacually sure how the naming convention should go.

 

e.g. Private _fontType As System.Drawing.Font = "Arial, 10, Bold"

 

Sorry for this, just new to the whole vb thing.

 

Cheers

 

Simon

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...