Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9286531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T19:26:24+00:00 2026-06-18T19:26:24+00:00

In order to use a ToolStripTextBox as menu item in practical programming I need

  • 0

In order to use a ToolStripTextBox as menu item in practical programming I need clearance for some things which behaves different as I would expect.

I have menu strip with few menu strip items among which is one textbox item.

1) After usage of textbox terminated with key ENTER I would like to close a menustrip but I dont know how.

I can hide it:

myToolStripMenuItem.HideDropDown()

But it stay sensitive if I move mouse over and then opens automatically.
I would like to close it that click would be needed for opening it again.

And second, If I activate menu with alt key and navigate down when selected item comes to that textbox it automatically throw this textbox in enter mode and such block keyboard navigation.
Is this normal behaviour and can this be avoided that (say) SPACE or ENTER would be need for turn a textbox in enter mode so I can pass with arrows (up/down) like over any other menu item?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T19:26:25+00:00Added an answer on June 18, 2026 at 7:26 pm

    I see the problem. The issue is that the toolstrip manager still has the menu in the active state so a mouse hover is going to open the menu again instead of selecting it. Fixing this is very difficult, the methods are internal. You can hack it by using Reflection, like this:

    ...
    using System.Reflection;
    
        void box_KeyDown(object sender, KeyEventArgs e) {
            if (e.KeyData == Keys.Enter) {
                e.Handled = e.SuppressKeyPress = true;
                myToolStripMenuItem.HideDropDown();
                var t = typeof(MenuStrip).Assembly.GetType("System.Windows.Forms.ToolStripManager+ModalMenuFilter", true);
                var mi = t.GetMethod("ExitMenuMode", BindingFlags.Static | BindingFlags.NonPublic);
                mi.Invoke(null, null);
            }
        }
    

    I can’t really recommend it. Nor would I recommend a text box in a menu. The UI hints are very poor, it just isn’t very discoverable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In order to use normal mapping in GLSL shaders, you need to know the
I would like to use ORDER BY FIELD() (MySQL) in Django. Does Django support
I've found that in order to use PRISM's classes in XAML you need to
I need to convert a 3-channel image to 1-channel in order to use Hough
In order to use WebHook URLs in Github, do I need to be logged
all is in the title :-) Some explanation : In order to use a
i would like to load a flash file in order to use it's functions
I want use ORDER BY RAND() query mysql. But I have some question want
I need Oleaut32.lib in order to use SysAllocString C++ function but I can't find
In order to use my Fluent NHibernate mappings on SQL Azure, I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.