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. Setting font properties for printing

Setting font properties for printing

Scheduled Pinned Locked Moved Visual Basic
tutorialgraphicsquestion
3 Posts 2 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.
  • J Offline
    J Offline
    jhoga
    wrote on last edited by
    #1

    I can't figure out how to use the the system.drawing.font to set multple properties of a fontstyle. For example: Dim vbFont3 As New System.Drawing.Font("Century Schoolbook", 12, FontStyle.Bold) I would like to also be Italic. Anybody know how to do this? Jerry Hogan

    D 1 Reply Last reply
    0
    • J jhoga

      I can't figure out how to use the the system.drawing.font to set multple properties of a fontstyle. For example: Dim vbFont3 As New System.Drawing.Font("Century Schoolbook", 12, FontStyle.Bold) I would like to also be Italic. Anybody know how to do this? Jerry Hogan

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

      FontStyle is has a FlagsAttribute. This means that you can combine them using bit-wise operations, like And and Or, like this:

      Dim vbFont3 As New Font("Century Schoolbook", 12, FontStyle.Bold Or FontStyle.Italic)

      This will create a new Font that is both Bold AND Italic, despite the Or operator in there. Remember, it's a bit-wise OR. Not one or the other. Dave Kreskowiak Microsoft MVP - Visual Basic

      J 1 Reply Last reply
      0
      • D Dave Kreskowiak

        FontStyle is has a FlagsAttribute. This means that you can combine them using bit-wise operations, like And and Or, like this:

        Dim vbFont3 As New Font("Century Schoolbook", 12, FontStyle.Bold Or FontStyle.Italic)

        This will create a new Font that is both Bold AND Italic, despite the Or operator in there. Remember, it's a bit-wise OR. Not one or the other. Dave Kreskowiak Microsoft MVP - Visual Basic

        J Offline
        J Offline
        jhoga
        wrote on last edited by
        #3

        Thanks Dave, U the Man:-D

        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