常乐居

常乐居

利用委拖来实现多控件回车跳转


 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        
For Each OBJCON As Control In Me.Controls
            
AddHandler OBJCON.KeyPress, AddressOf ComboBox1_KeyPress
        
Next
    
End Sub


 
Private Sub ComboBox1_KeyPress(ByVal sender As ObjectByVal e As System.Windows.Forms.KeyPressEventArgs)
        
If e.KeyChar = Chr(13Then
            e.Handled 
= True
            
Me.SelectNextControl(sender, TrueTrueTrueTrue)
        
End If
    
End Sub




posted on 2009-05-04 17:38  常乐  阅读(186)  评论(0编辑  收藏  举报

导航