看不懂颜色怎么变化的,文本框怎么和选项卡关联,还有。。。。。
Option Compare Database
Option Explicit
Private Sub Form_Load()
Call lblClick([Label0])
End Sub
Public Function lblClick(lbl As Label)
Dim Ctrl As Control
Me.cmdGetFocus.SetFocus
For Each Ctrl In Me.Controls
If TypeOf Ctrl Is Label Then
If lbl.Name = Ctrl.Name Then
Ctrl.BackColor = Ctrl.Tag
Ctrl.BorderColor = Ctrl.Tag
Me.Box2.BackColor = Ctrl.BackColor
Me.Detail.BackColor = Ctrl.BackColor
Me.lblTitle.Caption = Ctrl.Caption
Me.Box3.BorderColor = Ctrl.BackColor
Else
Ctrl.BackColor = 15000804
Ctrl.BorderColor = 12632256
End If
End If
If TypeOf Ctrl Is Page Then
If Ctrl.Name = "页" & CStr(Int(Right(lbl.Name, 1)) + 1) Then
Ctrl.Visible = True
Else
Ctrl.Visible = False
End If
End If
Next Ctrl
End Function
[此贴子已经被作者于2006-1-21 13:05:56编辑过]
|