Private Declare Function GetNextDlgTabItem Lib "user32" (ByVal hDlg As Long, _ ByVal hCtl As Long, ByVal bPrevious As Long) As Long Private Declare Function SetDlgFocus Lib "user32" Alias "SetFocus" _ (ByVal hwnd As Long) As Long
注释:移到下一个可Focus的Control Private Sub NextDlg() Dim hwnd5 As Long hwnd5 = GetNextDlgTabItem(Me.hwnd, Screen.ActiveControl.hwnd, 1) Call SetDlgFocus(hwnd5) End Sub
注释:移到上一个可Focus的Control Private Sub PrevDlg() Dim hwnd5 As Long hwnd5 = GetNextDlgTabItem(Me.hwnd, Screen.ActiveControl.hwnd, 0) Call SetDlgFocus(hwnd5) End Sub