. |
Option Compare Database Option Explicit Private Declare Function MoveWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long Private Declare Function GetCursorPos Lib "user32.dll" (lpPoint As POINT_TYPE) As Long Private Declare Function GetWindowRect Lib "user32.dll" (ByVal hwnd As Long, lpRect As Rect) As Long Private Type POINT_TYPE X As Long Y As Long End Type Private Type Rect left As Long top As Long right As Long bottom As Long End Type Private Sub Form_Open(Cancel As Integer) Dim coord As POINT_TYPE ' êîîðäèíàòû êóðñîðà Dim retval As Long ' âîçâðàùàåìîå çíà÷åíèå Dim r As Rect ' ðàçìåðû îêíà retval = GetCursorPos(coord) ' ñ÷èòûâàåì ïîçèöèþ êóðñîðà retval = GetWindowRect(Me.hwnd, r) ' ñ÷èòûâàåì ðàçìåðû òåêóùåãî îêíà ' Ïåðåìåùàåì îêíî ôîðìû ïî ïîçèöèè êóðñîðà retval = MoveWindow(Me.hwnd, coord.X, coord.Y + 10, r.right - r.left, r.bottom - r.top, 1) End Sub
Private Sub cmbApplication_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If Shift = 1 Then Me.cmbApplication.SetFocus If Me.cmbApplication.VALUE <> "" Then DoCmd.OpenForm "hfrmTipText", acNormal, , , acFormReadOnly, acWindowNormal Forms!hfrmTipText.lblTipText.Caption = Me.cmbApplication.Text End If End If End Sub