Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
%ID_Test_Label = 1001
CallBack Function MyDialogCB
'Don't care at this point.
'It's just got to be here.
End Function
'---------------------------------
Function MyDialog () As Long
Local hDlg As Dword
Local points&, style&, flags&, fontname$, mypoints&, mystyle&, colorval&, charset&
Local hFont1 As Dword
'
flags& = %CF_ScreenFonts Or %CF_Effects '<-- must have %cf_effects
'
Dialog New 0, "test", 75, 25, 100, 100, %WS_SysMenu Or %WS_Caption To hDlg
Display Font hDlg, 100, 50, "", points&, style&, flags& _
To fontname$, mypoints&, mystyle&, colorval&, charset&
Font New fontname$, mypoints, mystyle&, charset& To hFont1
'
Control Add Label, hDlg, %ID_Test_Label, "Some Text", 2, 2, 80, 20
Control Set Font hDlg, %ID_Test_Label, hFont1
Control Set Color hDlg, %ID_Test_Label, colorval&, -1& '<-- SET COLOR
'
Dialog Show Modal hDlg Call MyDialogCB
Font End hFont1
'msgbox hex$(colorval&) + $spc + hex$(mypoints&)
End Function
'-------------------------------------------------------
Function PBMain () As Long
Local x As Long
x = MyDialog
End Function
'gbs_00726
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm