cjard
Well-known member
- Joined
- Apr 25, 2006
- Messages
- 7,081
- Programming Experience
- 10+
I have a menu with a textbox as one og the items. When the user types an client reference number into the box, and presses return, i load a form to show the client details..
How can i get the menu to go away properly?
so far i have:
returnChar is worked out in advance by Convert.ToChar(Keys.Return)
the form is a mdi desktop that makes the client form an mdi child and loads the client data
it then shows the form..
..and hides the menu dropdown
..and focuses the child form
but the snag here is the menu is still active to mouseovers. if i point to the menu bar without clicking anything a menu will appear.. how can i close the menu properly, like clicking a menu item would?
How can i get the menu to go away properly?
so far i have:
VB.NET:
Private Sub JumpToClientNumber_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles JumpToClientNumber.KeyPress
If e.KeyChar = returnChar Then
frmClientDetail.MdiParent = Me
frmClientDetail.ShowClient(JumpToClientNumber.Text)
frmClientDetail.Show()
JumpToClientNumber.Text = JumpToClientNumber.Tag
ClientSetupToolStripMenuItem.HideDropDown()
frmClientDetail.Focus()
End If
End Sub
the form is a mdi desktop that makes the client form an mdi child and loads the client data
it then shows the form..
..and hides the menu dropdown
..and focuses the child form
but the snag here is the menu is still active to mouseovers. if i point to the menu bar without clicking anything a menu will appear.. how can i close the menu properly, like clicking a menu item would?