2012-07-30 2 views
2

KeyPress 이벤트를 사용하여 TextBox의 포커스를 변경했습니다. AutoComplete 옵션을 사용하기 전까지는 정상적으로 작동하지만 이후에는 작동하지 않습니다. KeyPress에 대한자동 완성 옵션이 포함 된 키 누르기 이벤트

코드 : TextBox에 대한

If Asc(e.KeyChar) = 13 Then 
      txtQuantity.Focus() 
      txtQuantity.SelectAll() 
      lastTxtBox = "name" 
End If 

코드 :

txtProductCode.AutoCompleteMode = AutoCompleteMode.Suggest 
txtProductCode.AutoCompleteSource = AutoCompleteSource.CustomSource 

는 둘 다 제안 옵션을 사용하고 싶습니다. keyDown 키 누르기도 변경했지만 여전히 작동하지 않습니다. 누구에게 어떤 아이디어가 있습니까? 대신

답변

0

사용 KeyDown 이벤트 : 그것은 나를 위해 완벽하게 작동

Private Sub TB_KeyDown(sender As Object, e As KeyEventArgs) Handles txtProductCode.KeyDown 
    If e.KeyCode = Keys.Enter Then 
     txtQuantity.Focus() 
     txtQuantity.SelectAll() 
    End If 
End Sub 

(테스트).

관련 문제