Populate Combo with Fontnames (1 Viewer)

r.harrison

It'll be fine (I think!)
Local time
Today, 21:01
Joined
Oct 4, 2011
Messages
134
Hi,

I'm looking to add a user settings functionality to my DB and wanted the user to be able to select which font, backcolor, forecolor Logo .... they want to see on there individual workstations.

What I need is to be able to create a combobox with a list of all the fontnames. Searched everywhere but can't find the code.

I'm assuming it'll look something like:

For each i in xxxx.fontnames
me.cbo_fonts.additem(i.name)
next

Any ideas?
 

r.harrison

It'll be fine (I think!)
Local time
Today, 21:01
Joined
Oct 4, 2011
Messages
134
Thanks for that, seems a little OTT for what I'm thinking. Maybe I'll just use a Value list of "Aerial";"Verdana";........ instead!

Thanks for the reply though!

You would have thought that a simple:

For each font in system.fonts

next

would be easier!
 

vbaInet

AWF VIP
Local time
Today, 21:01
Joined
Jan 22, 2010
Messages
26,374
Yep, that's the way to go. Just a small limited list of fonts would do.
 

r.harrison

It'll be fine (I think!)
Local time
Today, 21:01
Joined
Oct 4, 2011
Messages
134
Seemed so simple in my head!

Also looked at creating a color selector form, but again I think a simple list of pre-defined 'Themes' is the easier option!

Although I'm sure VB has a color selector form built in. Anything like that for VBA?
 

vbaInet

AWF VIP
Local time
Today, 21:01
Joined
Jan 22, 2010
Messages
26,374
It always does ;)

Nope, no colour picker in VBA. You will need to call the API.
 

r.harrison

It'll be fine (I think!)
Local time
Today, 21:01
Joined
Oct 4, 2011
Messages
134
Found an easier way.

1) Get a list of fonts off of Wikipedia
2) Put them as values in the ComboBox


Also on the color side, I went for 3 x sliders to adjust the R,G,B values

Simples!
 

r.harrison

It'll be fine (I think!)
Local time
Today, 21:01
Joined
Oct 4, 2011
Messages
134
Thanks Banana,

Interesting read, more than likely I'll be using this at some point soon.
 

Users who are viewing this thread

Top Bottom