control For Combo box Style
:wave: hiiii every body here in this Forum ,,, i want anyone help me okkk
:p i want to control for style of combo box such as :
i want to be style about combo box be :
0- Dropdown combo
1-simple combo
2-Dropdown List
can anybody know how can i cahnge this style on Runtime plz help me fast :rolleyes:
Re: control For Combo box Style
try this
VB Code:
Combo1.Style = 2
Combo1.Style = 1
Combo1.Style = 0
Re: control For Combo box Style
my dear this code is wrong and incorrect plz Find me another code becaue this tell me on error message that propertiy is read only on runtime if any one know any code plz tell me again ad thank you man for your post
Re: control For Combo box Style
I am sorry, you can not do that at runtime...combo's style property can be changed only at design time.
Re: control For Combo box Style
not at all my dear don't worry , but i need if any body have any idea to solve this problem plz tell me for it because i need it fast thanl you my dear again for your posting
Re: control For Combo box Style
if you tell us for what purpose you want to change the style we might give you better solution...
Re: control For Combo box Style
okkk man i will tell you :
i have Form which contain 2 option box , and , 1 combo box
i need when user choise first option box which name (write on combo box ) it make him to can write on combo box and can select any data on it .
on second option i need user when he choise this option box which name (choise on combo box ) he can choise from combo box and cant write on it also select from the list on combo box 2 .... okk man
Re: control For Combo box Style
you can use Forms controls' combo box and can assign the style property at runtime.
VB Code:
ComboBox1.Style = fmStyleDropDownCombo
ComboBox1.Style = fmStyleDropDownList
To add forms controls to your project click Project -> Components and select Microsoft Forms 2.0 Object Library and then add combobox to your form...
Re: control For Combo box Style
thank you very much my deaaaaaaaaar
you solve my problem thank you again
Re: control For Combo box Style
be aware that the Microsoft Forms 2.0 Object Library (FM20.dll) is not redistributable. It is installed as part of MS Office and you are not allowed to package it with your own exe. If your target users machine does not have the dll then your program will not run.
Have a look over at MSDN for more info - there is an ActiveX something or other that can be installed by users for free that installs the dll as part of it's install.
Re: control For Combo box Style
you mean that if i package my programe and sent it to any user that haven't or installed Ms Offfice on his computer the programe cant Run their okkk, but why Ms Commpany Built this Library if it Run only with MS office plz are you sure for it and tried to do it for another programe or someone told you about it ...............
Re: control For Combo box Style
when you come to distribute your package you distribute all the ocxs & dlls etc. that are also needed - but in order to be able to legally do this you must have the rights to redistribute those files.
You do not have the rights to distribute the FM20.dll - only M$ do (it is installed as part of MSOffice). If the user has MSOffice already installed, then no problems, your app will run fine.
If they don't have that dll, then your program won't run.
Here's the MSDN article: FM20.dll
Re: control For Combo box Style
You could put multiple comboboxes on the form, each with a different style, fill them all with the same data and make only one visible at a time. It's a waste of resources, but sometimes only a bigger hammer will do the job.