The Forms Designer and "nested" Properties.

P

Phill. W

I have a number of properties on a UserControl that are logically
related to one another and do a specific job. What I'd /like/ to do
is to have these properties available in the Forms Designer,
"grouped" together under a single "sub-heading", in the same way
as, for example, the standard Font, Location and Size properties.

I've wandered around the Browsable and DesignerSerializationVisibility
Attributes but the "nearest" I've got so far is a greyed-out text box
containing the name of the [inner] class I've used to lump these
properties together.

[pseudocode]
Class ListBox_Replacement
<Browsable(True) _
, DesignerSerializationVisibility(Content) > _
Public Property Deselector() as DeselectorC
Get
Return New DeselectorC(Me)
End Get
End Property

Public Class DeselectorC
Private m_oParent as ListBox_Replacement = Nothing

Friend Sub New( parent as ListBox_Replacement )
m_oParent = parent
End Sub

<Browsable(True)> _
Public Property Include() as Boolean
Get
Return m_oParent.Deselector_Include
End Get
Set ...
End Property

<Browsable(True)> _
Public Property Text() as String
Get ...
Set ...
End Property

End Class
End Class

Any suggestions how to do this?

(Still working with VB'2003).
TIA,
Phill W.
 
R

Rocky

Put them in a class. Then look into the TypeCoverter and
ExpandableObjectConverter classes.
 
P

Phill. W

Rocky,

Thanks!
Another Day, another "Magic Word" that unlocks another [small]
part of the Mystery that is the .Net Framework.

BTW, what /are/ we going to call the ".Net Framework" now that
Our Friends in Redmond have decided that ".Net" is a done deal;
old news; a bit passe and have dropped the term from the new
release of 'Studio?

Regards,
Phill W.


Rocky said:
Put them in a class. Then look into the TypeCoverter and
ExpandableObjectConverter classes.


Phill. W said:
I have a number of properties on a UserControl that are logically
related to one another and do a specific job. What I'd /like/ to do
is to have these properties available in the Forms Designer,
"grouped" together under a single "sub-heading", in the same way
as, for example, the standard Font, Location and Size properties.

I've wandered around the Browsable and DesignerSerializationVisibility
Attributes but the "nearest" I've got so far is a greyed-out text box
containing the name of the [inner] class I've used to lump these
properties together.

[pseudocode]
Class ListBox_Replacement
<Browsable(True) _
, DesignerSerializationVisibility(Content) > _
Public Property Deselector() as DeselectorC
Get
Return New DeselectorC(Me)
End Get
End Property

Public Class DeselectorC
Private m_oParent as ListBox_Replacement = Nothing

Friend Sub New( parent as ListBox_Replacement )
m_oParent = parent
End Sub

<Browsable(True)> _
Public Property Include() as Boolean
Get
Return m_oParent.Deselector_Include
End Get
Set ...
End Property

<Browsable(True)> _
Public Property Text() as String
Get ...
Set ...
End Property

End Class
End Class

Any suggestions how to do this?

(Still working with VB'2003).
TIA,
Phill W.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top