Postup:
Zalo₧te nov²
projekt. P°ipojte modul, a v n∞m deklarujte:
Declare Function
SetCursorPos Lib "user32" (ByVal x _ As Long, ByVal y As Long) As
Long
Do modulu p°idejte nßsledujφcφ
proceduru:
Public Sub Afocus()
If Me.BorderStyle = 0 Then
x& = Me.ActiveControl.Left \ Screen.TwipsPerPixelX
_
+ ((Me.ActiveControl.Width / 2) / Screen.TwipsPerPixelX)
_
+ (Me.Left / Screen.TwipsPerPixelX)
y& = Me.ActiveControl.Top \ Screen.TwipsPerPixelY
_
+ ((Me.ActiveControl.Height / 2) / Screen.TwipsPerPixelY)
_
+ (Me.Top / Screen.TwipsPerPixelY)
Else
x& = Me.ActiveControl.Left \ Screen.TwipsPerPixelX
_
+ ((Me.ActiveControl.Width / 2 + 60) / _
Screen.TwipsPerPixelX) + (Me.Left / _
Screen.TwipsPerPixelX)
y& = Me.ActiveControl.Top \ Screen.TwipsPerPixelY
_
+ ((Me.ActiveControl.Height / 2 + 360) / _
Screen.TwipsPerPixelY) + (Me.Top / _
Screen.TwipsPerPixelY)
End If
a& = SetCursorPos(x&, y&)
End Sub
Na formulß°
natßhn∞te pßr prvk∙ - tlaΦφtka, textboxy atd. a jim na udßlost
GotFocus dejte volßnφ procedury AFocus(). Spus¥te projekt a zkouÜejte se
pohybovat mezi prvky tabulßtorem. Ukazatel myÜi se bude automaticky p°esouvat.
|