Fonts

  • Thread starter Thread starter Bill English
  • Start date Start date
B

Bill English

Which class are the fonts located?

This is what I want to do:

Dim vFonts() as String = (FONTS HERE)

Then add all of the fonts to a checkbox.
 
Hi Bill:
Bill English said:
Which class are the fonts located?

--- They are located in the Font Class
This is what I want to do:

Dim vFonts() as String = (FONTS HERE)

Then add all of the fonts to a checkbox.
I don't understand what you are trying to do, but that's not going to
work....
If you want to set a Checkbox's font, you need to do something like this:
CheckBox1.Font = New System.Drawing.Font("Mistral", 8.25!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point,
CType(0, Byte))

This is the longest of the overloaded constructors and you can do it just
leaving most of the stuff to defaults.



So, if you wanted to , you could Dim vFonts() as Font = {LoadYourFontsHere}
or you could use something other than an array.

Then you could do checkBox1.Font = vFonts(0)

or checkBox1.Font = CType(MyFontArrayList(0), Font)

Note though that it can only have one font at a time. You can change it but
it's only got one font b/c it's simple bound. A combobox or listbox with
multiple items and you may or may not be able to manipulate the Font
property of the Text property for a given item, depends on the control and
if worse comes to worse, you can override and include what's missing.

I think I misunderstood your question though so please let me know if I
didn't answer it.



Cheers,



Bill
 
I meant combobox.

-----Original Message-----
Hi Bill:


--- They are located in the Font Class

I don't understand what you are trying to do, but that's not going to
work....
If you want to set a Checkbox's font, you need to do something like this:
CheckBox1.Font = New System.Drawing.Font("Mistral", 8.25!,
System.Drawing.GraphicsUnit.Point,
CType(0, Byte))

This is the longest of the overloaded constructors and you can do it just
leaving most of the stuff to defaults.



So, if you wanted to , you could Dim vFonts() as Font = {LoadYourFontsHere}
or you could use something other than an array.

Then you could do checkBox1.Font = vFonts(0)

or checkBox1.Font = CType(MyFontArrayList(0), Font)

Note though that it can only have one font at a time. You can change it but
it's only got one font b/c it's simple bound. A combobox or listbox with
multiple items and you may or may not be able to manipulate the Font
property of the Text property for a given item, depends on the control and
if worse comes to worse, you can override and include what's missing.

I think I misunderstood your question though so please let me know if I
didn't answer it.



Cheers,



Bill


.
 
Back
Top