Initializing FontDialog instance

G

Guest

How do I initialize the font parameters when creating an instance of the
FontDialog class? All the properties I'm interested in setting prior to
showing the dialog (Bold, Italic, etc.) have only "get" accessors but no
"set" access.
 
T

Tim Wilson

Create a new Font object and assign it to the Font property of the
FontDialog object before you call the ShowDialog method.
 
H

Herfried K. Wagner [MVP]

Lionel said:
How do I initialize the font parameters when creating an instance of the
FontDialog class? All the properties I'm interested in setting prior to
showing the dialog (Bold, Italic, etc.) have only "get" accessors but no
"set" access.

'Font' objects are immutable. Thus you will have to create a new 'Font'
object with the appropriate styles assigned (see overloaded versions of the
constructor).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top