PDA

View Full Version : increase width of combobox dropdown.


vikramdb
05-15-2002, 11:35 AM
HI...

I hate to say this is any forum - that, may be this is not the right place to ask - but I felt, you never know, you may get an answer , or perhaps get directions where to look for...

OK, I have a customized toolbar in word, on load of a new document I dynamically add a combox to it which just lists all user-defined styles.

Now the requirement is that, it should look as similar as possible to Word s built in styles dropdown. i.e when you click on the down arrow button on the styles combobox only the dropdown part will increase in width to accomodate the length of the largest style. the actual combobox on the formatting toolbar will remain of the same size. I hope i have conveyed the problem correctly, i.e even my combobox should enlarge when the down arrow is clicked, i.e only the drop down part should increase in width. Does anyone know how to do this ?

On more point I just cannot increase the width of the combobox itself randomly as I have to see that the entire toolbar is visible in 800 * 600 resolution.

Thanx in advance
vikram db

vikramdb
05-20-2002, 12:55 PM
HI all ...

I found the solution for this so I thought I should POST that too.
I was actually adding a msoControlComboBox dynamically to my customised toolbar...

Dim obj As CommandBarControl
Set obj = CommandBars(TOOLBARS_NAME).Controls.Add(msoControl ComboBox, , , , True)

After setting the object, I observed the object s properties in the watch window. I was happy to see that there is a DropDownWidth property which we can use to just set the width of the dropdown (not the control). So simple...

Some people even told me that what i was asking was possible in access controls... I was surprised..

Anne Troy
05-20-2002, 01:36 PM
Great idea, vikramdb. Thanks for posting the answer!

~Dreamboat
TheWordExpert