Link to home
Start Free TrialLog in
Avatar of Jim Horn
Jim HornFlag for United States of America

asked on

Combo box drop-down: left justified vs. right justified logic

When you click on a combo box that contains a valid .RowSource property, a drop-down appears.  Is there any logic for whether the drop-down is left-justified or right-justified to the combo box, and if so what is it?

I'm trying to create a combo box that is only .Width=.2, and have the drop-down extend left to match the width of a textbox there, and instead it is going right.

Right-justified meaning the right edge of the dropdown is aligned with the right edge of the control.
Left-justified meaning the left edge of the dropdown is aligned with the left edge of the control.

TIA
-Jim
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

The logic I've seen is numeric vs. text, and follows the same rules Excel does for default formatting.  

Numeric = left-justified
Text = right-justified (General)
Anything not strictly numeric = text

Avatar of jmantha709
jmantha709

I think you mean you want to control were the dropdown will be aligned and not the values in it...

If so, you can't control that.  Normally the dropdown's left edge will be aligned with it's combobox left edge unless there isn't enough space on the screen.
DOH!  Yeah, I misunderstood what you were asking.  jmantha709 has it right, I think.  Have you played with putting the control next to the edge of the form/screen?
Avatar of Jim Horn

ASKER

I just figured it out, it's ComboBox.ScrollBarAlign property, which in addition to changing the scrollbar location also changes the alignment of the dropdown.

Learn something new every day.

I had a sized form, where my combo box was on the far right side, and the drop-down was going to the right, away from the form.

Barring any objections, I'll ask for a PAQ/Refund on this one.
I've seen this happen when I've built my list/combo and supplied it's source in default font, and then changed the font size.
Don't know if it helps...
ScrollBarAlign...I said that didn't I?  :)  PAQ/Refund, aye.
ASKER CERTIFIED SOLUTION
Avatar of CetusMOD
CetusMOD
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial