943,822 Members | Top Members by Rank

Ad:
Mar 6th, 2008
1

Change Font

Expand Post »
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
Similar Threads
Reputation Points: 37
Solved Threads: 7
Junior Poster in Training
Estella is offline Offline
99 posts
since Jan 2008
Mar 6th, 2008
5

Re: Change Font

see this attachment :

Change Font.zip

Hope this helps...
PS: don't remove author name n comment
Reputation Points: 1182
Solved Threads: 392
Posting Sensei
Jx_Man is offline Offline
3,140 posts
since Nov 2007
Mar 6th, 2008
1

Re: Change Font

Try using looping through all the controls on the form that have font property.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Mar 6th, 2008
0

Re: Change Font

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
Reputation Points: 30
Solved Threads: 49
Posting Pro
choudhuryshouvi is offline Offline
553 posts
since May 2007
Mar 6th, 2008
0

Re: Change Font

thanks jx_man. its great program. and debsisdas thx for the logic.
Reputation Points: 37
Solved Threads: 7
Junior Poster in Training
Estella is offline Offline
99 posts
since Jan 2008
Mar 7th, 2008
1

Re: Change Font

you're welcome
Reputation Points: 1182
Solved Threads: 392
Posting Sensei
Jx_Man is offline Offline
3,140 posts
since Nov 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: help me in my thesis:D
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: searching data use datagrid and access





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC