Results 1 to 2 of 2

Thread: Changing textbox font during run-time?

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 1999
    Posts
    39

    Post

    How exactly do i get the little window to change the font of a textbox during runtime?

    i'm using vb6, and apparently (or at least for me) the font common dialog box is no longer in service.

    Any help would be appreciated. thanks.

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,176

    Post

    Just change the FontName and Fontsize Properties, eg.
    Code:
        Text1.FontName = "Arial"
        Text1.FontSize = 18
    The Commondialogbox should work, but you have to specify a Flag, eg.
    Code:
    Private Sub Command1_Click()
        On Error GoTo FontErr
        With CommonDialog1
            .CancelError = True
            .Flags = cdlCFScreenFonts
            .ShowFont
            Text1.FontName = .FontName
            Text1.FontSize = .FontSize
        End With
    FontErr:
    End Sub
    ------------------
    Aaron Young
    Analyst Programmer
    aarony@redwingsoftware.com
    adyoung@win.bright.net

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width