title image


Smiley Re: Popup-Kalender im Unterformular positionieren
So etwas geht über die API:



Private Const SM_CXCURSOR = 13

Private Const SM_CYCURSOR = 14

Private Const TwipsPerPixel = 12



Private Type POINTAPI

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 Declare Sub GetCursorPos Lib "user32" (lpPoint As POINTAPI)

Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long

Private Declare Function MoveWindow Lib "user32" (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 GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long



Public Function ShowCalendar()

Const AdjLeft = 0.6, AdjTop = 0.3

Dim P As POINTAPI, R As RECT, Wid As Long, Hgh As Long, X As Long, Y As Long, _

Tmp As String, hWnd As Long, Frm As Form



GetCursorPos P

X = P.X '+ GetSystemMetrics(SM_CXCURSOR) * AdjLeft

Y = P.Y '+ GetSystemMetrics(SM_CYCURSOR) * AdjTop

DoCmd.OpenForm "frmCalendar", , , , , acHidden, Tmp

DoEvents

Set Frm = Forms!frmCalendar

Frm.SetFocus

hWnd = Frm.hWnd

GetWindowRect hWnd, R

Wid = R.right - R.left

Hgh = R.bottom - R.top

MoveWindow hWnd, X, Y, Wid, Hgh, True

Frm.Visible = True

End Function



Gruß aus dem Norden
Reinhard


Bitte immer die Access-Version angeben!
DB-Wiki


Wie man Fragen richtig stellt

YaccessAccess-FAQUnd ansonsten: Wikipedia




geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: