CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2001
    Posts
    2

    MultiColumn ComboBox

    I need a combobox with at least two columns...
    Actually, i need to use it in a .asp page...


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: MultiColumn ComboBox

    use the combobox that comes with Microsoft Form 2.0 Object LIbrary. It supports multiple columns

    'another===
    'Access like combo (OCX)

    http://www.planetsourcecode.com/xq/A...s/ShowCode.htm

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: MultiColumn ComboBox

    THis is a code for multiple columns in list box. I think it will work for combo box too.

    'module
    Const LB_SETTABSTOPS = &H192
    Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Sub SetListTabStops(iListHandle As Long)
    ' sets 2 tab stops in a list box at the 24th
    ' and 48th character
    ' iListHandle = the window handle of the list box
    Dim iNumColumns As Long
    Dim iListTabs(1) As Long
    Dim Ret As Long

    iNumColumns = 2

    iListTabs(0) = 96 ' 96/4 = 24 characters
    iListTabs(1) = 192 ' 192/4 = 48 characters

    Ret = SendMessage(iListHandle, LB_SETTABSTOPS, iNumColumns, iListTabs(1))
    End Sub

    'form
    Private Sub Form_Load()
    Call SetListTabStops(lstMyListBox.hwnd)
    lstMyListBox.AddItem "Column 1 data" & vbTab & "Column 2 data"
    End Sub


    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

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

Featured