Make Global Property Application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rusdyrip
    New Member
    • Jan 2008
    • 29

    Make Global Property Application

    hi all,

    anyone to know how to make Global Property
    so if i change Font size, all form on my application will change

    did i must change the designer every form?

    thx
  • VBWheaties
    New Member
    • Feb 2008
    • 145

    #2
    Originally posted by rusdyrip
    hi all,

    anyone to know how to make Global Property
    so if i change Font size, all form on my application will change

    did i must change the designer every form?

    thx
    why not create a single method requiring a parameter of type Form and loop through every control on the form assigning it your desired font?
    Something like this:

    Code:
    Public Sub ApplyFont(frm As Form, NewFontName As String) 
       Dim ctrl as Control 
       On Error Resume Next
       For Each ctrl On frm.Controls
          err.Clear
          ctrl.Font.Name = NewFontName
       Next
    End Sub

    Comment

    • Ali Rizwan
      Banned
      Contributor
      • Aug 2007
      • 931

      #3
      Do all things as VBWheaties said then in every form call the fuction at startup your all form's control's font property will be changed.

      Regards
      >> ALI <<

      Comment

      • rusdyrip
        New Member
        • Jan 2008
        • 29

        #4
        thx

        it solve my problem

        Comment

        Working...