Change Font

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jan 2008
Posts: 97
Reputation: Estella is an unknown quantity at this point 
Solved Threads: 6
Estella's Avatar
Estella Estella is offline Offline
Junior Poster in Training

Change Font

 
1
  #1
Mar 6th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Change Font

 
4
  #2
Mar 6th, 2008
see this attachment :

Change Font.zip

Hope this helps...
PS: don't remove author name n comment
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,134
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 132
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: Change Font

 
1
  #3
Mar 6th, 2008
Try using looping through all the controls on the form that have font property.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 538
Reputation: choudhuryshouvi is an unknown quantity at this point 
Solved Threads: 49
choudhuryshouvi's Avatar
choudhuryshouvi choudhuryshouvi is offline Offline
Posting Pro

Re: Change Font

 
0
  #4
Mar 6th, 2008
as debasisdas said,

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. dim ctlcontrol as object
  2. dim fn as string,fsize as integer
  3.  
  4. fn="comic sans ms"
  5. fsize=10
  6.  
  7. on error goto font_mistake
  8.  
  9. for each ctlcontrol in form1.controls
  10. ctlcontrol.font=fn
  11. ctlcontrol.fontsize=fsize
  12. next
  13.  
  14. exit sub
  15.  
  16. font_mistake:
  17. err.clear
  18. resume next

hope u'll grab some idea.

regards
Shouvik
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 97
Reputation: Estella is an unknown quantity at this point 
Solved Threads: 6
Estella's Avatar
Estella Estella is offline Offline
Junior Poster in Training

Re: Change Font

 
0
  #5
Mar 6th, 2008
thanks jx_man. its great program. and debsisdas thx for the logic.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Change Font

 
1
  #6
Mar 7th, 2008
you're welcome
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC