I need help with fonts in vb6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shalabh Anand
    New Member
    • Aug 2006
    • 2

    I need help with fonts in vb6

    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
  • NSF12345
    New Member
    • Aug 2006
    • 21

    #2
    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

    Comment

    • Shalabh Anand
      New Member
      • Aug 2006
      • 2

      #3
      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

      Comment

      • NSF12345
        New Member
        • Aug 2006
        • 21

        #4
        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

        Comment

        • Hemant Pathak
          Recognized Expert New Member
          • Jul 2006
          • 92

          #5
          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

          Comment

          • NSF12345
            New Member
            • Aug 2006
            • 21

            #6
            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

            Comment

            Working...