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

    Opening a dropdown programmatically?

    I have a drop down which, when the user types, I want to present them with the correct option from the drop down list which matches what they type.

    I want this to happen with the dropdown open though. Anyone know how to make a dropdown ...erm... drop down using code without the user having to click it?

    Something like with a treeview, where you can set ...

    Node.Expanded = True

    ...is there any way to set ...

    MyDropDown.Opened = True

    ... or something like that?

    Cheers.

  2. #2
    Join Date
    Feb 2001
    Location
    PA
    Posts
    163
    Try using Sendkeys "{F4}" when the dropdown has focus.

    Cubbie

  3. #3
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    From an example of Francesco Balena

    A way to open it via code
    (provided dropdown is combobox)
    Attached Files Attached Files
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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