Syntax
| DlgCreateFont(FontName[, FontHeight][, FontWidth][, Bold][, Italic][, _
Underline][, StrikeThru]) | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description
| Create an instance of a new font object and return the Fontname Windows handle from the newly created font.
Font objects are used in dialog boxes to change the appearance of the dialog items. The returned handle should be stored in a module-level or global-level declared variable, so it's value can be read from within a dialogfunc routine.
| ||||||||||||||||
See Also
| |||||||||||||||||
Example
| Dim hFont As Long
Sub Main
Begin Dialog UserDialog 400,203,"FontTest",.userFunction ' %GRID:10,7,1,1
Text 30,14,100,35,"Text1",.Text1
TextBox 150,14,110,35,.TextBox1
OKButton 90,70,90,21
End Dialog
Dim dlg As UserDialog
hFont = DlgCreateFont("FixedSys")
Dialog dlg
DlgDeleteFont hFont
End Sub
Private Function userFunction(DlgItem$, Action%, SuppValue&) As Boolean
Select Case Action%
Case 1 ' Dialog box initialization
DlgSetFont SuppValue, DlgControlId("Text1"), hFont
Case 2 ' Value changing or button pressed
Case 3 ' TextBox or ComboBox text changed
Case 4 ' Focus changed
Case 5 ' Idle
Case 6 ' Function key
End Select
End Function
|