VB Migration Partner

KNOWLEDGE BASE - Forms and controls


Previous | Index | Next 

[HOWTO] Determine the font used for forms and controls

VB.NET doesn’t support the following standard (non True Type) fonts: Courier, Fixedsys, Modern, MS Sans Serif, MS Serif, Roman, Script, Small Fonts, System, Terminal, and all WST_* fonts. VB Migration Partner automatically converts references to these fonts to references to Courier New (if the font is monospaced, as is the case of Courier and Fixedsys) or Arial (in all other cases). If the default substitution strategy doesn’t work well for you, or if you want to change fonts during the migration process, you can use one of the following three pragmas.

First, you can use the FormFont pragma to set the Font property of all the forms that don’t specify a given font themselves. This pragma can affect the current form only, or you can use project-level scope to affect all the forms in the application. This is the easiest way to change fonts for all the forms in the application:

         '## project:FormFont Courier New

You can specify a font size too:

         '## project:FormFont Courier New, 12

Second, you can replace all occurrences of a given font with a different font, while keeping the original font size, by means of the ReplaceFont pragma. Again, this pragma can have form- and project-level scope. For example, you can replace all Arial fonts with Arial Narrow fonts using this pragma:

         '## project:ReplaceFont Arial, Arial Narrow

Third, you can replace specific combinations of font name/font size with a different name/size combination by means of the ReplaceFontSize pragma. For example, you can replace all occurrences of Arial 10 with Arial Narrow 12, using this pragma:

         '## project:ReplaceFontSize Arial, 10, Arial Narrow, 12
Previous | Index | Next 




Follow Francesco Balena on VB6 migration’s group on

LinkedIn





Read Microsoft Corp’s official case study of a VB6 conversion using VB Migration Partner.




Code Architects and its partners offers remote and onsite migration services.

More details




Subscribe to our free newsletter for useful VB6 migration tips and techniques.

newsletter



To learn more about your VB6 applications, run VB6 Analyzer on your source code and send us the generated text file. You will receive a detailed report about your VB6 applications and how VB Migration Partner can help you to quickly and effectively migrate it to .NET.

Get free advice



A fully-working, time-limited Trial Edition of VB Migration Partner allows you to test it against your actual code

Get the Trial




The price of VB Migration Partner depends on the size of the VB6 application, the type of license, and other factors

Request a quote




Migrating a VB6 application in 10 easy steps

Comparing VB Migration Partner with Upgrade Wizard

Migration tools: Feature Comparison Table

All whitepapers