Main Menu

KB#00644-How to easily change the fonts for all controls in a GUI window

Title:

How to easily change the fonts for all controls in a GUI window

Description:

When programming in Visual PRO/5, it may be desirable to use a font other than the default. In some cases, the default font may be too large or too small. In others, you may want to use a nicer looking font or one that has the desired upper order ASCII character set. 

The 'FONT' mnemonic can be used to change the font of a single control, but is there an easy way to change it for all of the controls in the window?

Resolution:

In Visual Pro/5 2.0, this can be accomplished via the 'WINFONT' mnemonic. The 'WINFONT' mnemonic sets the default font for a window and its contained controls. Additionally, all new controls and text drawn into a window will be set to the default font. 

In Visual Pro/5 1.0x, the 'WINFONT' mnemonic does not exist, but it can be accomplished programatically. To change the font for all of the controls at once, call a subroutine that has the following piece of code: 

for I = 0 to 500 
print(sysgui,err=NEXTI)'FONT'(I,"Times New Roman",14,18) 
NEXTI: next I 

Notes: 
This will work as long as your boundaries defined in the FOR encompass all of your control IDs. As an example, if you had control IDs that extended to 650, then you'd want to modify the upper limit of the FOR to be 650.



Last Modified: 03/31/1998 Product: Visual PRO/5 Operating System: Windows

BASIS structures five components of their technology into the BBx Generations.

  Google+ View BASIS LinkedIN ProfileVisit our Twitter Feed Check out our Facebook Public Profile Click to View the BASIS youTube channel