Coflict Between Shorcuts And Keyevent?

Dec 11, 2009

I have a button with shortcuts is F5 Now i have a other textbox and code :

Private Sub RichTextBox2_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtdathanhtoan.KeyUp
ElseIf (e.Control = True AndAlso e.KeyCode = Keys.D6) Or e.KeyCode = Keys.F5 Then
txtdathanhtoan.Text = txtdathanhtoan.Text & "000000"
End If
End Sub

When above textbox focus. I PRESS F5 , but the button perform , textbox didn't perform.I want when i press F5 then FOCUSED Textbox perform not button.

View 6 Replies


ADVERTISEMENT

C# :: Send KeyEvent From A Form To A Control?

Jun 18, 2009

I have a Windows.Worms application. In one of my forms I display a DataGridView with a ContextMenu (not ContextMenuStrip) associated to it. The MenuItems in the ContextMenu have Shortcuts defined.This is how the ContextMenu is created:

Private _contextMenu As _
New ContextMenu( _
New MenuItem() { _

[code]...

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved