$OPTIMIZE ON
$APPTYPE GUI
$TYPECHECK ON
DIM Newfont AS QFONT
NEWFONT.COLOR=0
DIM Fontdialog AS QFONTDIALOG
DECLARE SUB Fontdlg
CREATE Form AS QFORM
CAPTION="Form"
TOP=100
LEFT=50
CREATE Button1 AS QBUTTON
CAPTION = "GET FONT INFO"
Left = 50
HEIGHT = 30
ALIGN=1
Onclick=fontdlg
WIDTH=150
END CREATE
CREATE REDIT AS QRICHEDIT
ALIGN=5
END CREATE
END CREATE
SUB Fontdlg
FontDialog.COLOR=NEWFONT.COLOR
IF FontDialog.EXECUTE THEN
FontDialog.SetFont(NEWFONT)
END IF
REDIT.TEXT= "NAME= " & NEWFONT.NAME
REDIT.ADDSTRINGS "COLOR= " & STR$(NEWFONT.COLOR)
REDIT.ADDSTRINGS "SIZE= " & STR$(NEWFONT.SIZE)
REDIT.ADDSTRINGS "BOLD= " & STR$(NEWFONT.BOLD)
REDIT.ADDSTRINGS "ITALIC= " & STR$(NEWFONT.ITALIC)
REDIT.ADDSTRINGS "UNDERLINE= " & STR$(NEWFONT.UNDERLINE)
REDIT.ADDSTRINGS "STRIKEOUT= " & STR$(NEWFONT.STRIKEOUT)
BUTTON1.FONT=NEWFONT
END SUB
FORM.SHOWMODAL
|