need help with propertygrid...

lidds

Junior Contributor
Joined
Nov 9, 2004
Messages
210
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:

Code:
   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
 
Thanks a lot. Don't suppose you know how to do the same for a system font i.e. font family, size etc.

Cheers

Simon
 
PlausiblyDamp said:
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
 
Back
Top