|
-
Oct 17th, 2002, 04:59 AM
#1
Thread Starter
New Member
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
"Dream it, b'caz U can do it!"
-
Oct 18th, 2002, 07:38 AM
#2
New Member
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
-
Oct 18th, 2002, 07:46 AM
#3
New Member
replace where i typed DropDown and TheDropDown with whatever you want to name the property of course 
example: ShowIt and TheShowIt
-
Oct 19th, 2002, 12:52 AM
#4
Thread Starter
New Member
thanks
Thanks Eric...this is what i was looking for. it solved my prob...
One more help pl... i have one more property by the name "FileName".. it requires the file type like "*.csv" files..
i wanted to popup "FileOpen" Dialog box.. when the FileName Property is selected... pl. help me in getting this option.
Thanks in adv...
Venu
"Dream it, b'caz U can do it!"
-
Oct 19th, 2002, 04:15 AM
#5
PowerPoster
Include Microsoft Common Dialog Control component in you form/project. Then use this code
VB Code:
Public Property Get FileName()
CommonDialog1.Filter = "CSV Files (*.csv)|*.csv"
CommonDialog1.ShowOpen
End Property
-
Oct 19th, 2002, 07:04 AM
#6
Thread Starter
New Member
thanks for the help...
in this code.. when ever i draw this control from tool box to from.. this OpenDialog is poped up..
i wanted to generate this only when user select this from "Propery window".. and more over in "Propery Window" the a small button with 3 dots(...) should appear to represent that there will be a dialog box on click on this property..
Ex... 'Picture' property of the Image Control.
thanks in adv.
Venu Bharadwaj
"Dream it, b'caz U can do it!"
-
Oct 19th, 2002, 02:04 PM
#7
PowerPoster
I am not on a computer which has VB6. I will see it tommorow when I have access to a box with VB6.
-
Oct 19th, 2002, 04:41 PM
#8
New Member
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...
-
Oct 21st, 2002, 04:13 AM
#9
Thread Starter
New Member
Thanks eric, but ....
i got the ellipses, but i'm getting the data Format Page along with FileOpen Dialog box page...
any idea.. how to get only FileOen Dialog.. i'm coding FileOpen in the Get Property method...
Thanks in adv.
Venu Bharadwaj
Last edited by bharadwajrv; Oct 21st, 2002 at 04:20 AM.
"Dream it, b'caz U can do it!"
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
|