Results 1 to 2 of 2

Thread: ComboBox - dropdown width?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    top of the mountain
    Posts
    234

    Question ComboBox - dropdown width?

    How to make a combobox dropdown part wider than the width fo the actual control?

    regard j

  2. #2
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108

    Your Problem is Solved

    I am sorry I didn't get to your post, I was in a hurry. Anyhow, use this code to make the combo width longer. I had to upgrade the code from some old website, but I hope you enjoy anyhow.

    VB Code:
    1. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam As Object) As Integer
    2.  
    3.     Private Sub SetComboWidth(ByRef cboCombo As System.Windows.Forms.ComboBox, ByRef lngWidth As Integer)
    4.         SendMessage(cboCombo.Handle.ToInt32, &H160S, lngWidth, 0)
    5.     End Sub
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

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