Option Explicit
Private Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
Private Declare Function SetWindowFocus Lib "user32" Alias "SetFocus" (ByVal hWnd As Long) As Long
Public Sub Walk2Next(ByVal hWndMe As Long, ByVal KeyCode As Integer)
Dim hWndFirst As Long, hWndLast As Long, hWndPrev As Long, hWndNext As Long
Dim hWndTarget As Long
Private Sub Form_Load()
Dim ctl As Control
For Each ctl In Controls
If Not TypeOf ctl Is Frame Then
If Not ctl.Container.Name = Text1.Container.Name Then
ctl.TabStop = False
Else
ctl.TabStop = True
End If
End If
Next
End Sub
Private Sub Form_Load()
Dim ctl As Control
For Each ctl In Controls
If Not TypeOf ctl Is Frame Then
If Not ctl.Container.Name = "Frame1" Then
ctl.TabStop = False
Else
ctl.TabStop = True
End If
End If
Next
End Sub
楼主,兑现你的承诺吧“如能解决,此贴可加到200分,决不食言”
此对于控件数组我没有试过。对于非数组检验通过。
Private Sub Form_Load()
Dim ComButton As Control
For Each ComButton In Controls
If TypeOf ComButton Is CommandButton Then
str = ComButton.Container
If InStr(1, str, Frame1.Name) = 0 Then ComButton.TabStop = False