vbAccelerator - Contents of code file: Test270Font_frmTest270Font.frm
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 7185
ClientLeft = 2265
ClientTop = 1980
ClientWidth = 6585
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 479
ScaleMode = 3 'Pixel
ScaleWidth = 439
Begin VB.CommandButton Command1
Caption = "Command1"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 2760
TabIndex = 0
Top = 360
Width = 1335
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private m_fnt As cFontCache
Private Sub Command1_Click()
Dim hFont As Long
Dim hFontOld As Long
hFont = m_fnt.hFont(Me.Font, 2700, Me.hDC)
Dim tR As RECT
tR.left = 16 + 15
tR.top = 16 - 8
tR.right = 16
tR.bottom = 16 + 28 + 4
hFontOld = SelectObject(Me.hDC, hFont)
DrawText Me.hDC, "&Steve", -1, tR, DT_LEFT Or DT_SINGLELINE Or DT_VCENTER
Me.Line (16, 16)-(16 + 15, 16 + 28 + 4), &H0, B
Debug.Print tR.right - tR.left, tR.bottom - tR.top
SelectObject Me.hDC, hFontOld
End Sub
Private Sub Form_Load()
Set m_fnt = New cFontCache
End Sub
|
|