Announcement

Collapse
No announcement yet.

Fonts Macro

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fonts Macro

    Yet another Fonts Macro. Kind of a pita/distracting to create a New Font/size when working on a new control/dialog/graphic, so I just do it once at the top of the program and then changes on the fly are easy. Just change the array designator.

    Code:
      
    '
    ' *******************************************************
    '
    Macro Fonts_Setup
    '   put Global at top of program or change to Local here
    '   Global f_Script(), f_Comic(), f_Courier(), f_Arial(), f_Consolas() As Dword
       Local ctr As Long
        ctr = 72 'Max size of type used
       ReDim f_Comic(1 To ctr), f_Courier(1 To ctr), f_Arial(1 To ctr), f_Consolas(1 To ctr), _
             f_Script(1 To ctr)
       For ctr = 1 To ctr                                             
          Font New "Comic MS Sans", ctr To f_Comic(ctr) 
          Font New "Courier", ctr To f_Courier(ctr) 
          Font New "Arial", ctr To f_Arial(ctr) 
          Font New "Consolas", ctr To f_Consolas(ctr) 
          Font New "Bickley Script", ctr To f_Script(ctr) 
       Next ctr
    End Macro            
    '
    ' *******************************************************
    '
     
    'Example Code:
        Graphic Set Font f_Script(60)  'f_Comic(36)
        Graphic Set Pos (1, 10)
        Graphic Print Msg$
    '
    'Or
    CONTROL SET FONT [I]hDlg[/I], [I]id&[/I], f_Script(60)  'f_Comic(36)
    Last edited by Gösta H. Lovgren-2; 19 Jul 2009, 11:12 PM.
    It's a pretty day. I hope you enjoy it.

    Gösta

    JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
    LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/
Working...
X