Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How can i set the font of a VB form programmatically / Dynamically

How can i set the font of a VB form programmatically / Dynamically

Scheduled Pinned Locked Moved Visual Basic
helpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sp_ranjan
    wrote on last edited by
    #1

    I want to change the fonts of the VB forms dynamically.My intension is to change the font depending on the System's Regional and language settings during runtime.I have tried the Form1.Font = "Tahoma" .Even though it didnt give any error, it did not make any changes.Please help. :)Regards Ranjan

    S D 2 Replies Last reply
    0
    • S sp_ranjan

      I want to change the fonts of the VB forms dynamically.My intension is to change the font depending on the System's Regional and language settings during runtime.I have tried the Form1.Font = "Tahoma" .Even though it didnt give any error, it did not make any changes.Please help. :)Regards Ranjan

      S Offline
      S Offline
      sathish s
      wrote on last edited by
      #2

      chk this http://uk.builder.com/programming/windows/0,39026618,39233186,00.htm

      1 Reply Last reply
      0
      • S sp_ranjan

        I want to change the fonts of the VB forms dynamically.My intension is to change the font depending on the System's Regional and language settings during runtime.I have tried the Form1.Font = "Tahoma" .Even though it didnt give any error, it did not make any changes.Please help. :)Regards Ranjan

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        Setting the font of the Form will not change the font of the controls on it. (Each control will have it's own Font property.) It only changes the font of the titlebar and any text directly written, using only certain methods, to the form surface itself. Also, you change the Font by creating a new Font object, not specifying a string. One possibility is:

        myForm.Font = New Font("Tahoma", 8)

        The Font class has about a dozen constructors, so you can find out more here[^]. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome -- modified at 14:44 Monday 6th March, 2006

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups