PDA

Click to See Complete Forum and Search --> : Changing textbox font during run-time?


Falcondl
Nov 30th, 1999, 03:01 AM
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.

Aaron Young
Nov 30th, 1999, 03:09 AM
Just change the FontName and Fontsize Properties, eg.

Text1.FontName = "Arial"
Text1.FontSize = 18


The Commondialogbox should work, but you have to specify a Flag, eg.

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