lidds Posted February 8, 2005 Posted February 8, 2005 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 Quote
Administrators PlausiblyDamp Posted February 8, 2005 Administrators Posted February 8, 2005 Private _colour As System.Drawing.Color = System.Drawing.Color.Red Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
lidds Posted February 8, 2005 Author Posted February 8, 2005 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 Quote
Administrators PlausiblyDamp Posted February 8, 2005 Administrators Posted February 8, 2005 Exactly the same - just declare a variable / property of type font and assign a font to the variable. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
lidds Posted February 9, 2005 Author Posted February 9, 2005 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 Quote
Administrators PlausiblyDamp Posted February 9, 2005 Administrators Posted February 9, 2005 For all font constructors Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.