Guidance
指路人
g.yi.org
software / rapidq / Examples / String & Text / GetFontInfo.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
'From:  billk2867 <wakcanton@a...>  Fri Jan 3, 2003  1:54 am

'After FontDialog.SetFont(NEWFONT) get the properties of NEWFONT.
'I needed this info for an INI file and discovered I could get these
'properties! I think this is undocumented?!

' BILL K
     $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 ' Form

     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
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-4-19  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2003-01-03 08:10:51