MenuStrip doesn't accept first click.
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: MenuStrip doesn't accept first click.

  1. #1
    Join Date
    Dec 2012
    Posts
    22

    MenuStrip doesn't accept first click.

    Hi folks. Just wondering if anyone else has this problem and if there is a fix, or is it just me...

    I place a MenuStrip on a form, run the application, mouse hover changes the colour and highlights the first level options, but the first mouse click on the menu is ignored. I have to click the menu twice to get the first level to 'realise' it has been clicked, as if there is some loose focus event somewhere not releasing the mouse click event.

    Anyone?

    Cheers.

  2. #2
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,982

    Re: MenuStrip doesn't accept first click.

    Probably helps to upload some CODE of the events in the Form, and how it's called. Use CODE TAGS, please.
    Code:
    ' Like This!
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Dec 2012
    Posts
    22

    Re: MenuStrip doesn't accept first click.

    The code makes no difference, simple things like popping a message box, opening another form. I have the problem if the menu system is blank, null and void of code.

    I can place a menu, setup the structure in the designer and replicate the problem every single time the form is loaded without any code anywhere. Can you not replicate this?

  4. #4
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,982

    Re: MenuStrip doesn't accept first click.

    No, but I can help with samples of how to do it correctly. See the link http://code.msdn.microsoft.com/
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Dec 2012
    Posts
    22

    Re: MenuStrip doesn't accept first click.

    Ok, let me start again and explain fully, in case I've missed something.

    Create a new project.
    Add a button, or a menu, or anything that calls another form, as in:
    Dim New frm as frmUsers
    frm.Show (or) frm.ShowDialog
    Add a menustrip to the second form, add some controls to the strip at design time.
    Add some code to a menu item, msgbox, what ever you like.
    Run the application.
    Click the menu strip.

    If the form is shown modally the first click is ignored, the second displays the menu map you have created.
    If the second form is just 'shown' (Show) then the first click sends the form to the background, you then have to move the first form to see the second form and you'll find the menustrip on the second form now works. Can you confirm this is the case for you also?

  6. #6
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,982

    Re: MenuStrip doesn't accept first click.

    that doesn't call another form, it creates a NEW instance of it, and operates on that copy, not the originial
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  7. #7
    Join Date
    Dec 2012
    Posts
    22

    Re: MenuStrip doesn't accept first click.

    Oh for **** sake.

    PUT A MENUSTRIP ON A FORM, CREATE THE FORM, TEST THE MENUSTRIP.
    DOES IT WORK PROPERLY?
    Last edited by HanneSThEGreaT; January 3rd, 2013 at 01:56 AM. Reason: Removed Profanity

  8. #8
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,091

    Re: MenuStrip doesn't accept first click.

    Hi tclancey.

    Which version of Visual Basic is this?

    I know that there are some issues with the controls which usually gets fixed with a service pack.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center