Results 1 to 3 of 3

Thread: [2005] How to get a ComboBox to frop on MouseOver event?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    252

    Question [2005] How to get a ComboBox to frop on MouseOver event?

    Hi,

    To save the user some clicks, I'd like my ComboBox lists, of which there are several, to drop down on a Mouse Enter event.

    I can set up the .MouseEnter event handler Sub, but what code should be used to make it drop down? A simulated click?

    This is what I have so far, the shell of an event handler:

    VB Code:
    1. ''' <summary>
    2.   ''' TEST code for getting cbo's to drop on a Mouse Enter event.
    3.   ''' </summary>
    4.   ''' <param name="sender"></param>
    5.   ''' <param name="e"></param>
    6.   ''' <remarks>One pubic sub should work for ALL cbo's. Each cbo needs to be
    7.   ''' listed with Handles, say cboXYZ.MouseEnter</remarks>
    8.   Public Sub AutoDropCboList(ByVal sender As System.Object, _
    9.                              ByVal e As System.EventArgs) _
    10.                              Handles cboSingle.MouseEnter
    11.  
    12.     Dim activeCbo As ComboBox = CType(sender, ComboBox)
    13.  
    14.     ' umm, now what??
    15.  
    16.   End Sub

    Thx!
    Last edited by Flying-Kiwi; Jan 18th, 2007 at 01:36 AM.

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

    Re: [2005] How to get a ComboBox to frop on MouseOver event?

    I've lost count of the number of times I've posted this advice. If you want to do something to or with a specific class then go to the MSDN library and read the help topics for the class and its member listsing. More times than not the answer will be clear, if not completely obvious.
    Attached Images Attached Images  
    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

    Thread Starter
    Addicted Member
    Join Date
    Dec 2005
    Posts
    252

    Re: [2005] How to get a ComboBox to frop on MouseOver event?

    Well that was embarassingly, and happily, easy.

    Point taken. I thought it was going to require some nasty API stuff. I missed that property.

    Many thx.

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