liquid8 Posted May 27, 2003 Posted May 27, 2003 I am currently using a property grid to show the properties of a class Appearance. This has all the appearance properties of a BaseObject. I have an ObjectImage class that inherits BaseObject, and has its own Appearance class which shadows the BaseObject class. When I set up the property grid to show the properties for ObjectImage, it only shows me the BaseObject properties. What am I doing wrong? Thanks, LiQuiD8 Quote
liquid8 Posted May 29, 2003 Author Posted May 29, 2003 I may not have explained this well enough for anyone to answer. I sort of solved the problem, but not the way I wanted to. Basically I have a BaseObject Class, and want to have a seperate class with properties for Appearance, Data, etc.. The way I am currently doing this is: Public Class BaseObject Public Appearance as New Appearance End Class Public Class Appearance Public Property Font() as Font Public Property Color as Color End Class In Code, I create a new instance of the BaseObject: Dim newObject as new BaseObject I can successfully set all the underlying Appearance properties from the code, such as newObject.Appearance.Font, but setting the property grid to newObject, does not allow me to access the Appearance properties. Right now I just put all the properties in the same class, and Categorized them, but I want to have seperate classes for different property types. Any help would be appreciated. Thanks, LiQuiD8 Quote
*Gurus* divil Posted May 29, 2003 *Gurus* Posted May 29, 2003 You want the appearance property of your first class to be expandable in the property grid? Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
liquid8 Posted May 30, 2003 Author Posted May 30, 2003 you got it :) right now I just threw all the properties into the objects class, and used <category> Public Class BaseObject <Category("Appearance")> _ Public Property Opacity End Class but i would like to keep my appearance properties all in a seperate class LiQuiD8 Quote
*Gurus* divil Posted May 30, 2003 *Gurus* Posted May 30, 2003 You need to make a TypeConverter for your Appearance class that derives from ExpandableObjectConverter. You link the two together by sticking a TypeConverterAttribute on the Appearance class. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
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.