Combo Box for ActiveX Control
Hi,
In my ActiveX Control,
1. One Property of the control take only two values. ie. 'True' or 'False'. for this i wanted to give it in drop down combo box, when they click on that property in the the 'Property' of the my control.
Ex. 'Visible' property of Textbox control.
how to code for this...
thanks in adv...
Venu
i think this is what you wish to do?
In General Declarations section of your user control add:
Private TheDropDown As Boolean
In Private Sub Usercontrol_ReadProperties add:
DropDown= PropBag.ReadProperty("DropDown", False)
In Private Sub Usercontrol_WriteProperties add:
PropBag.WriteProperty "DropDown", DropDown, False
Then after that you add:
Public Property Get DropDown() As Boolean
DropDown= TheDropDown
End Property
Public Property Let DropDown(ByVal NewValue As Boolean)
TheDropDown = NewValue
If DropDown= True Then
TheDropDown = True
Else
TheDropDown = False
End If
PropertyChanged "DropDown"
End Property
how to add ellipses (3 dots) button to property ....
hey Venu...this should do what you're asking...
Article from microsoft knowledge base:
1) Open the UserControl project in Visual Basic.
2) From the Tools Menu, click Procedure Attributes. The Procedure Attributes dialog box appears.
3) In the Procedure Attributes dialog box, click Advanced >>. The Procedure Attributes dialog box expands to display additional attributes
4) In the Procedure ID listbox, select the name of the property.
5) In the Use This Page in Property Browser list box, select the property page to displayed for the property. Click Apply to apply this setting, then click OK to close the dialog box.
The ellipses button should now appear in the container property page. If the form hosting the UserControl is still open in your project, it may be necessary to right-click on the form (in design mode) and select "Update UserControl" to refresh the property window.
on a further note from me... you can also set the description of each property you add in the procedure attributes dialog ....
on the subject of "fileopen"...you can use an api call w/o using the control on your project (although using the api creates a dependency the same as using the control itself). i'll post again later when i have more time
have a great day Venu... :)