Get Font Dialog to Remember Font Properties

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sly9er
    New Member
    • Jun 2010
    • 9

    #1

    Get Font Dialog to Remember Font Properties

    Hello All,

    I have a vb.net windows form with several text boxes.

    Upon filling in the text boxes, each text box updates a designated label on the form.

    Each text box also has it's own button to set the font and font size of the current label connected to each individual text box.

    The button opens the fontDialog and lets me enter in the specifics and update the label.

    But if I go to another text box and do some work, and then return to the first text box again to change the font size, I notice that the font size in the dialog box no longer matches the original font size I chose for that that label.

    How can I set things up to tell the fontDialog to remember the font properties of each label so the correct properties are in the fontDialog when I open the fontDialog for a given label?

    I hope my question made sense.

    I hope to hear from you soon. :)

    Thanx in advance for any help you can provide.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Before showing the FontDialog, populate the Font property with the font you want it to start out as.

    Comment

    • sly9er
      New Member
      • Jun 2010
      • 9

      #3
      Populate the font property of what?

      The label, or the font dialog?

      If the label, isn't it already populated?

      If the font dialog, that is my question. How do I do that?

      I need the font dialog to know the font family, and the font size of the label before the font dialog even opens.

      Comment

      • sly9er
        New Member
        • Jun 2010
        • 9

        #4
        I added this to the font dialog button click event:

        FontDialog1.Fon t = Panel1Heading1T ext.Font

        Panel1Heading1T ext is the name of the label.

        Thanks Plater, although you were quite vague about it,

        you pointed me in the right direction.

        Sort of :)

        Comment

        Working...