Results 1 to 6 of 6

Thread: ComboBox DropDown orientation

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    13

    Talking ComboBox DropDown orientation

    Hi,
    Somebody has a clue on how can I set the dropdown orientation of a ComboBox ?
    I just can't find any API that does that and Comboboxes do not have any Align Property.
    It's just because when my ChildForm is maximised, I have some ComboBoxes at the far right and when dropped, we just can't access the sliders...
    Thanx

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Play around with this code until you get your combo boxes just the right width when the form is maximized.
    VB Code:
    1. Private Sub Form_Resize()
    2. Combo1.Width = Me.Width - 3000
    3. End Sub

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Another option, although in my opinion, a less desirable option, would be to have the combo drop down automatically when the control received focus.
    VB Code:
    1. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
    2.  
    3. Private Const CB_SHOWDROPDOWN = &H14F
    4.  
    5. Private Sub Combo1_GotFocus()  
    6.    Dim DropMe As Long
    7.    DropMe = SendMessage(Combo1.hwnd, CB_SHOWDROPDOWN, 1, ByVal 0&)
    8. End Sub

  4. #4
    I think he means have the equivalent of the Align property so text in the dropdown could be right-aligned instead of left-aligned, in which case I'd say try changing the RightToLeft property of the control.

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    13
    I am not sure, but I don't think these pieces of code fix the DropDown orientation...

  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    13
    You got my point FilBurt1. but my project does not allow me to set the RightToLeft property of my control to True...
    Must be something about the language

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width