Adding a user control property thats a class or structure 
Author Message
 Adding a user control property thats a class or structure

Ive posted this in vb.net and CSharp because if someone can show this in
csharp I can convert it to vb.net for my use.

I have a class, MsgBoxParts that I want to use as a property for my
textboxex control, but when its in the designer, it shows the property
grayed out in the property grid. I want it to look like the Location
property would, with a plus that expands it to list the properties of this
class (in location its X and Y). I know this is possible, I just skimmed an
article the other week on it but I cant for the life of me find the article
now. It was on MSDN, WindowForms.Net or some website on the .net languages.
So could someone shed some light on how to make it show up this way? Thanks.

<Description("Customized error message, only used if custom validation is
selected " & _

"or AlwaysUseCustomError is true."), Category("Validation")> _

Property CustomErrorMessage() As MsgBoxParts

Get

Return _CustomErrorMessage

End Get

Set(ByVal Value As MsgBoxParts)

If _ValidationPattern = Expressions.Custom Or _AlwaysUseCustomError Then

_ErrorMessage = Value

End If

_CustomErrorMessage = Value

End Set

End Property



Thu, 22 Sep 2005 02:41:38 GMT  
 Adding a user control property thats a class or structure

says...

Quote:
> I have a class, MsgBoxParts that I want to use as a property for my
> textboxex control, but when its in the designer, it shows the property
> grayed out in the property grid. I want it to look like the Location
> property would, with a plus that expands it to list the properties of this
> class (in location its X and Y). I know this is possible, I just skimmed an
> article the other week on it but I cant for the life of me find the article
> now. It was on MSDN, WindowForms.Net or some website on the .net languages.
> So could someone shed some light on how to make it show up this way? Thanks.

I think you're looking for this article:

http://makeashorterlink.com/?F5D0125F1

--
Patrick Steele
Microsoft .NET MVP
http://radio.weblogs.com/0110109



Thu, 22 Sep 2005 04:05:51 GMT  
 Adding a user control property thats a class or structure
Thank you! That was the exact article! Much appreciated



Quote:

> says...
> > I have a class, MsgBoxParts that I want to use as a property for my
> > textboxex control, but when its in the designer, it shows the property
> > grayed out in the property grid. I want it to look like the Location
> > property would, with a plus that expands it to list the properties of
this
> > class (in location its X and Y). I know this is possible, I just skimmed
an
> > article the other week on it but I cant for the life of me find the
article
> > now. It was on MSDN, WindowForms.Net or some website on the .net
languages.
> > So could someone shed some light on how to make it show up this way?
Thanks.

> I think you're looking for this article:

> http://makeashorterlink.com/?F5D0125F1

> --
> Patrick Steele
> Microsoft .NET MVP
> http://radio.weblogs.com/0110109



Thu, 22 Sep 2005 05:35:48 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. how to declare properties of a user control as new structure

2. MSScript Control:: Adding User Created Class Objects To It

3. Structures as class properties

4. Is it possible to add user properties to existing controls

5. adding combobox type property to user control

6. Adding a font property to a user control

7. Adding a reference to an assembly thats in the GAC

8. if i refresh the page it adds another record.....and thats not what i want

9. Serializing a Class within a Class (Previously Structures)

10. type mismatch when passing class-structures to a custom control

11. type mismatch when passing class-structures to a custom control

12. Access (read and write) C++ classes and structures in VB through ActiveX control

 

 
Powered by phpBB® Forum Software