AW: Kreis in Form zeichnen
14.11.2005 16:37:46
Leo
Hi,
ist ziemlich aufwändig, Beispiel für eine Linie:
Private Declare Function GetForegroundWindow Lib "user32.dll" () As Long
Private Declare Function GetDC Lib "user32.dll" (ByVal hWnd As Long) As Long
Private Declare Function TextOut Lib "gdi32.dll" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private Declare Function SetBkMode Lib "gdi32.dll" (ByVal hdc As Long, ByVal nBkMode As Long) As Long
Private Declare Function SetTextColor Lib "gdi32.dll" (ByVal hdc As Long, ByVal crColor As Long) As Long
Private Declare Function LineTo Lib "gdi32.dll" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function MoveToEx Lib "gdi32.dll" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByRef lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private hWnd As Long
Private Sub UserForm_Click()
Dim hdc As Long
Dim position As POINTAPI
hdc = GetDC(hWnd)
If hWnd Then
MoveToEx hdc, 50, 50, position
LineTo hdc, Me.Width / 2, Me.Height - 50
End If
End Sub
Private Sub UserForm_Activate()
hWnd = GetForegroundWindow
End Sub
mfg Leo