ش | ی | د | س | چ | پ | ج |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Sub ActiveObjects()
Dim frm As Form, ctl As Control
' Return Form object pointing to active form.
Set frm = Screen.ActiveForm
MsgBox frm.Name & " is the active form."
' Return Control object pointing to active control.
Set ctl = Screen.ActiveControl
MsgBox ctl.Name & " is the active control " _ & "on this form."
End Sub
در کد بالا با مسیج باکس نام فرم فعال و نام کنترل فعال را نمایش میدهد.