Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi, I want to make my datagrid column cells to accept short cut keys defined by myself.

I created a textbox control and I want to press F5 when the cell is selected my groupbox will be visible on the form.

 

Private Sub dbrDay_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown

'If dbrDay.CurrentCell.ColumnNumber = 3 Then And e.KeyCode = Keys.F5 Then

e.Handled = True

grpVendor.Visible = True

Else

grpVendor.Visible = False

e.Handled = False

End If

End Sub

This doesn't work!

Thanks for your help

  • *Experts*
Posted
You are checking for the key press in the Form's KeyDown event,right? (im asking becuase the name of the sub doesnt tell much :) and you could be inherting the control). If yes and you have controls on your form, form will not catch the keydown event without KeyPreview.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...