Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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

Posted

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

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...