Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing The GUI Default Font

Status
Not open for further replies.

NeilFrank

Programmer
Mar 12, 2000
167
CA
The design time GUI default font - at least on my version(s) of VB6 - is MS Sans Serif, ie any control I add to a form has this font property. How can I change this? I would have thought that the Options Dialog Box (Tools/Options...) would do the trick, but I can't get that to work.

TIA

\stuck in MSSansSerif

 
Haven't figured out how 2 change default perm. myself. But, if the first thing you do with a form (BEFORE adding anything) is change it's font 2 what you want, the controls you add after that will default to what you selected for the form. Tim

Remember the KISS principle:
Keep It Simple, Stupid!
 
Thanks very much, Tim. Simple, indeed!

For those of you who want complicated, I dreamed up the following after I posted my question last night...

\Unstuck from MSSansSerif


Private Sub Form_Load()
SetFormFont

End Sub

'gives Comic Sans MS, but any font can be 'requested'
Private Sub SetFormFont()
Dim intCount As Integer, strFont As String
Dim Ctrl As Control, Frm As Form

For intCount = 1 To 100
strFont = Screen.Fonts(intCount)
If strFont = "Comic Sans MS" Then
Set Frm = Me
On Error Resume Next
For Each Ctrl In Frm.Controls
Ctrl.Font = Screen.Fonts(intCount)
Next Ctrl
Exit Sub
End If
Next intCount

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top