PC Review


Reply
Thread Tools Rate Thread

Create a property in usercontrol ?

 
 
Agnes
Guest
Posts: n/a
 
      9th Jul 2004
I create my own usercontrol ( a textbox user control) and with a new
property.
For this property , i want to let the user to choose the choice (like combox
box) during design mode . How can I do that ?



 
Reply With Quote
 
 
 
 
ZorpiedoMan
Guest
Posts: n/a
 
      9th Jul 2004
Just set up an Enum with the choices:

Public Enum ChoiceType
Choice1
Choice2
Choice3
End Enum

Private myChoice as ChoiceType
Public Property ChoiceProperty as ChoiceType
Get
Return mychoice
End Get
Set(Value as Choicetype)
myChoice = value
End Set
End property


--Zorpy

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      9th Jul 2004
* "Agnes" <(E-Mail Removed)> scripsit:
> I create my own usercontrol ( a textbox user control) and with a new
> property.
> For this property , i want to let the user to choose the choice (like combox
> box) during design mode . How can I do that ?


\\\
Public Class Foo
Inherits UserControl

Public Enum Bla
Bla1
Bla2
Bla3
End Enum

Private m_Bla As Bla
 
Reply With Quote
 
Agnes
Guest
Posts: n/a
 
      12th Jul 2004
That's great. It works ~~~
Thanks a lot
"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> ???
news:(E-Mail Removed) ???...
> * "Agnes" <(E-Mail Removed)> scripsit:
> > I create my own usercontrol ( a textbox user control) and with a new
> > property.
> > For this property , i want to let the user to choose the choice (like

combox
> > box) during design mode . How can I do that ?

>
> \\\
> Public Class Foo
> Inherits UserControl
>
> Public Enum Bla
> Bla1
> Bla2
> Bla3
> End Enum
>
> Private m_Bla As Bla
> .
> .
> .
> Public Property Bla() As Bla
> Get
> Return m_Bla
> End Get
> Set(ByVal Value As Bla)
> m_Bla = Value
> End Set
> End Property
> End Class
> ///
>
> Have a look at the 'System.ComponentModel' namespace and the attributes
> defined in this namespace if you want to hide properties from the text
> editor or add a description text, for example.
>
> --
> Herfried K. Wagner [MVP]
> <URL:http://dotnet.mvps.org/>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      12th Jul 2004
Hi Agnes,

>That's great. It works ~~~


There are not much in this newsgroup who doubt about that when Herfried has
typed in a message himself and not wrote that it was quick and dirty. (And
than mostly it works as well).

How you do recognise those

Look if he used "Foo and Bla".

:-)

Cor


 
Reply With Quote
 
Agnes
Guest
Posts: n/a
 
      13th Jul 2004
Foo and Bla ?[ In fact I don't know what does it mean .]
Cor, Do u mean I am too rude to reply Herfried ?
If yes, I am sorry about that .
"Cor Ligthert" <(E-Mail Removed)> ¦b¶l¥ó
news:O5RFeK$(E-Mail Removed) ¤¤¼¶¼g...
> Hi Agnes,
>
> >That's great. It works ~~~

>
> There are not much in this newsgroup who doubt about that when Herfried

has
> typed in a message himself and not wrote that it was quick and dirty.

(And
> than mostly it works as well).
>
> How you do recognise those
>
> Look if he used "Foo and Bla".
>
> :-)
>
> Cor
>
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      13th Jul 2004
Hi Agnes,

>Do u mean I am too rude to reply Herfried ?


No absolute not, however I am sometimes rude to Herfried to prickle him and
to see how he acts than, this time I did want to give him an indirect
compliment and used your message for it and show you as well that most of us
who are active on this newsgroup appriciate Herfried although we are
sometimes rude to him.

(Herfried knows that when I am rude to him it has no deeper impact as well
as when Herfried does that to me)

Cor


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a property that is a usercontrol Rex the Strange Microsoft ASP .NET 1 5th Dec 2006 06:04 PM
UserControl with a Decimal Property with a DefaultValue is not handled correctly by Property Editor Shadow Lynx Microsoft VB .NET 0 12th Apr 2006 02:18 AM
Usercontrol property appears in property grid but not intellisense Bruce Wood Microsoft Dot NET Framework Forms 2 21st Nov 2005 05:18 PM
Getting a property of a control inside a usercontrol, from another usercontrol Fabiano Microsoft ASP .NET 2 3rd Jun 2005 10:56 AM
UserControl Enum Property Bold in WinForms Property window Kakaiya Microsoft Dot NET 0 15th Apr 2005 03:37 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:33 AM.