954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Change Font

I want to change font of all controls in a form.
how i can do this?? i can change font but just for each control not all control in a same time...
please help :)

Estella
Junior Poster in Training
99 posts since Jan 2008
Reputation Points: 64
Solved Threads: 7
 

see this attachment :

Change Font.zip


Hope this helps...
PS: don't remove author name n comment

Attachments Change_Font.zip (6.3KB)
Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

Try using looping through all the controls on the form that have font property.

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

as debasisdas said,

dim ctlcontrol as object
dim fn as string,fsize as integer

fn="comic sans ms"
fsize=10

on error goto font_mistake

for each ctlcontrol in form1.controls
   ctlcontrol.font=fn
   ctlcontrol.fontsize=fsize
next

exit sub

font_mistake:
   err.clear
   resume next


hope u'll grab some idea.

regards
Shouvik

choudhuryshouvi
Posting Pro
553 posts since May 2007
Reputation Points: 30
Solved Threads: 49
 

thanks jx_man. its great program. and debsisdas thx for the logic.

Estella
Junior Poster in Training
99 posts since Jan 2008
Reputation Points: 64
Solved Threads: 7
 

you're welcome

Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You