-
November 1st, 2001, 06:44 AM
#1
Dynamic property of user control
I Am developing a user control (Active x control) using Visual Basic.I want to create
my property which can take say three values.For that it should display A combo box.
How can i create a combo box for a property.
Extending this i want to create a property which can be populated when
initialize event is fired.I want to dynamically populate it.Say i want
to put all names of controls which are present in the form
in that list.How can i do this.
-
November 1st, 2001, 10:38 AM
#2
Re: Dynamic property of user control
<de-lurk>
You can add your own 'Enumerations' for the property window using the Enum keyword in VB when defining a 'type', eg - paste this into a new user control :
option Explicit
'
public Enum YourType
TypeOne
TypeTwo
TypeThree
End Enum
'
private mMember as YourType
'
public property let Member(byval yt as YourType)
' fill in the blanks here
End property
'
public property get Member() as YourType
' fill in the blanks here
End property
If you then added this control to a form and looked at the property window, you'll see the 'Member' property now has a dropdown with the three values available from the enumeration
</de-lurk>
Chris Eastwood
VBCodeLibrary - http://www.vbcodelibrary.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|