- Option Explicit
- Private Declare Function GetTickCount& Lib "kernel32" ()
- Const DC_ACTIVE = &H1
- Const DC_NOTACTIVE = &H2
- Const DC_ICON = &H4
- Const DC_TEXT = &H8
- Const BDR_SUNKENOUTER = &H2
- Const BDR_RAISEDINNER = &H4
- Const EDGE_ETCHED = (BDR_SUNKENOUTER Or BDR_RAISEDINNER)
- Const BF_BOTTOM = &H8
- Const BF_LEFT = &H1
- Const BF_RIGHT = &H4
- Const BF_TOP = &H2
- Const BF_RECT = (BF_LEFT Or BF_TOP Or BF_RIGHT Or BF_BOTTOM)
- Const DFC_BUTTON = 4
- Const DFC_POPUPMENU = 5
- Const DFCS_BUTTON3STATE = &H10
- Const DT_CENTER = &H1
- Const DT_LEFT = &H0
- Const DC_GRADIENT = &H20
- Private Type RECT
- Left As Long
- Top As Long
- Right As Long
- Bottom As Long
- End Type
- Private Declare Function DrawCaption Lib "user32" (ByVal hWnd As Long, ByVal hdc As Long, pcRect As RECT, ByVal un As Long) As Long
- Private Declare Function DrawEdge Lib "user32" (ByVal hdc As Long, qrc As RECT, ByVal edge As Long, ByVal grfFlags As Long) As Long
- Private Declare Function DrawFocusRect Lib "user32" (ByVal hdc As Long, lpRect As RECT) As Long
- Private Declare Function DrawFrameControl Lib "user32" (ByVal hdc As Long, lpRect As RECT, ByVal un1 As Long, ByVal un2 As Long) As Long
- Private Declare Function DrawText2 Lib "user32" Alias "DrawTextW" (ByVal hdc As Long, ByRef lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
- Private Declare Function SetRect Lib "user32" (lpRect As RECT, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
- Private Declare Function OffsetRect Lib "user32" (lpRect As RECT, ByVal x As Long, ByVal y As Long) As Long
- Dim ret As Long, i As Long
-
- Private Sub Command1_Click()
- Dim R As RECT
-
- Me.Cls
-
- Me.ScaleMode = vbPixels
-
- SetRect R, 0, 0, Me.ScaleWidth, 20
-
- ret& = GetTickCount&
-
- DrawText2 Picture1.hdc, "Hello World !", Len("Hello World !"), R, DT_LEFT
-
- End Sub
Не могу понять почему выводиться текст квадратиками? Может я что то не объявил ещё...
Ответить
|