Results 1 to 4 of 4

Thread: CompoBox

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2011
    Posts
    118

    CompoBox

    How to Make the drop-down menu rise to the top instead of descending down in compobox

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: CompoBox

    I don't know the answer to your question but, as noone else has answered either, I'll provide what information I can. There is no public interface in the ComboBox class to do that, e.g. there is no DropDownDirection property. The drop-down list will automatically display above the control if there is not enough room on the screen to display it below. If you want to force that behaviour then you'd have to inherit the ComboBox class and do it yourself. I'm not sure how it would be done but I would guess that it would involve trapping one or more Windows messages in an overridden WndProc method. Working out if that is the case and which message(s) to trap may not be easy.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,385

    Re: CompoBox

    As JMcIlhinney said, there is no built-in DropDownDirection property. You'll have to create it in an inherited class. Here is a class by JuggaloBrotha that is a MenuButton, it's similar to what you want, but in more of a button style as opposed to a combobox style.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Dec 2011
    Posts
    118

    Re: CompoBox

    thanks

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