Private Sub Rectangle_properties(ByVal Rectanglename As String)
'-----------------------------------------------------
'Dim frm As Form
'Set frm = Screen.ActiveForm ' 返回指向活动窗体的 Form 对象。
Dim CtlA As Access.Control
'循环处理活动窗体的所有控件
For Each CtlA In Me.Controls
If CtlA.ControlType = acRectangle Then '针对 矩形 控件进行遍历设置
If CtlA.Name = Rectanglename Then
With CtlA
' .borderwith = 3
.BackStyle = 1
.BorderColor = 16744448
.BorderStyle = 1
End With
Else
With CtlA
' .borderwith = 1
.BackStyle = 0
.BorderColor = 0
.BorderStyle = 0
End With
End If
End If
Next CtlA
End Sub
Private Sub 矩形1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call Rectangle_properties(Me.矩形1.Name)
End Sub
Private Sub 矩形2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call Rectangle_properties(Me.矩形2.Name)