Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
How to move focus from one to another user control when enter is keydown like with tab?
User control contains textbox and label, event is declared for grid...
This code work for Controls but no work for user control....
Sorry for my bad English...
VB
Private Sub drzac_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Input.KeyEventArgs)
       Dim tb As New Control
       tb = e.Source
       If e.Key = Key.Enter Then
           tb.MoveFocus(New TraversalRequest(FocusNavigationDirection.Next))
       End If
   End Sub
Posted

Your user control is a single control, you need to handle when it gets the focus and then focus on the control you want to focus on within that control.
 
Share this answer
 
Resolve, thank you, you were right :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900