Connecting Tech Pros Worldwide Forums | Help | Site Map

I need help with fonts in vb6

Newbie
 
Join Date: Aug 2006
Posts: 2
#1: Aug 24 '06
I want to create an application which at run time can change font and this changed font must apply to all the controls in the form

Newbie
 
Join Date: Aug 2006
Posts: 21
#2: Aug 24 '06

re: I need help with fonts in vb6


Do a Combo Box, not positive about the code for it, but try something simple first like, on a button, do an onlick event to do this:

Command1.Font = "MS Comic Sans"

that should change the font to Comic Sans
Newbie
 
Join Date: Aug 2006
Posts: 2
#3: Aug 24 '06

re: I need help with fonts in vb6


he main problem with this is that if i change the fontsize also the caption will either be too large to fit on the control or it will be too small i want the things not to get haphazard the form and controls on them should also resize accordingly
Newbie
 
Join Date: Aug 2006
Posts: 21
#4: Aug 24 '06

re: I need help with fonts in vb6


Im not sure about that. When you change the fonts, you'd also have to have some code that would alter the width and height of all the items, which i have no idea to lol unfortuneatly, not every object has the auto-resize feature, but that be risky on the form layout.

sorry i cant help any more
Expert
 
Join Date: Jul 2006
Location: Delhi India
Posts: 92
#5: Aug 24 '06

re: I need help with fonts in vb6


Hi Shalabh Anand

if do u want to change the caption & font size of any Label Control then set the Autosize=true it is a Label Control property.
if u want to getting the all true font in run time then try this code
Newbie
 
Join Date: Aug 2006
Posts: 21
#6: Aug 24 '06

re: I need help with fonts in vb6


Quote:

Originally Posted by Hemant Pathak

Hi Shalabh Anand

if do u want to change the caption & font size of any Label Control then set the Autosize=true it is a Label Control property.
if u want to getting the all true font in run time then try this code

trouble with that is it is too risky that the layout would be off with the form. What you could do (which sounds horrible, and might make the .exe massive) is have LOADS of forms, 1 for each font style you wish to do. Have a combo box on each form, and when the box is changed, it changes to the form with the appropriate font. Just an idea, but i wouldnt do it. I'd make them stick to one font if thats what needed to be done
Reply