Results 1 to 5 of 5

Thread: Prevent combobox control from droping down?

  1. #1

    Thread Starter
    Addicted Member CoMMiE's Avatar
    Join Date
    Jul 2000
    Location
    Malaysia, Kuala Lumpur
    Posts
    179

    Prevent combobox control from droping down?

    Hi
    does anyone here have any idea on how to prevent the combobox to dropdown when the user click on the combobox button?

    i tried to use the following code but it does not seems to do what i want:

    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

    Private Sub MultiComboBox_DropDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.DropDown
    Const CB_SHOWDROPDOWN = &H14F


    SendMessage(combobox.Handle.ToInt32, CB_SHOWDROPDOWN, True, 0)

    End Sub

    Thanks
    Last edited by CoMMiE; Oct 6th, 2003 at 06:11 AM.
    To follow the path:
    look to the master,
    follow the master,
    walk with the master,
    see through the master,
    become the master.-ZEN

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    First , all longs to integers . Second , False lParam . Takes nothing . Try this :
    VB Code:
    1. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As
    2. Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
    3. Const CB_SHOWDROPDOWN = &H14F
    4.  
    5.  Private Sub ComboBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.Click
    6.  
    7. SendMessage(ComboBox1.Handle.ToInt32, CB_SHOWDROPDOWN, False, 0)
    8.  
    9. End Sub

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Why not just use a textbox?

  4. #4
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    why not set it's style to ComboBoxStyle.Simple ?
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  5. #5

    Thread Starter
    Addicted Member CoMMiE's Avatar
    Join Date
    Jul 2000
    Location
    Malaysia, Kuala Lumpur
    Posts
    179
    i am trying to replace the dropdown of the combobox with my own listview, so that i can have a multicolumn combobox
    To follow the path:
    look to the master,
    follow the master,
    walk with the master,
    see through the master,
    become the master.-ZEN

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