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. C#
  4. Problem in FontStyle property

Problem in FontStyle property

Scheduled Pinned Locked Moved C#
helpquestion
6 Posts 5 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.
  • K Offline
    K Offline
    Krishnraj
    wrote on last edited by
    #1

    Hi all, Is it possible to have a text's fontstyle property to Bold, Italic and underline at the same time. If yes then how????? Thanks in advance

    Rana Krishnraj

    L H L 3 Replies Last reply
    0
    • K Krishnraj

      Hi all, Is it possible to have a text's fontstyle property to Bold, Italic and underline at the same time. If yes then how????? Thanks in advance

      Rana Krishnraj

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      The documentation says: This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values. So yes it is possible. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      Voting for dummies? No thanks. X|


      1 Reply Last reply
      0
      • K Krishnraj

        Hi all, Is it possible to have a text's fontstyle property to Bold, Italic and underline at the same time. If yes then how????? Thanks in advance

        Rana Krishnraj

        H Offline
        H Offline
        half life
        wrote on last edited by
        #3

        the Coding Way: create a new Font(new FontFamily("Tahoma"), 12.75f); (for Example) and change what ever u want in it then assgin it to text's font property The Designer View Way : or Go To the component in the Design View and click on the Font Property then Cahnge What ever u Like

        Have Fun Never forget it

        K 1 Reply Last reply
        0
        • H half life

          the Coding Way: create a new Font(new FontFamily("Tahoma"), 12.75f); (for Example) and change what ever u want in it then assgin it to text's font property The Designer View Way : or Go To the component in the Design View and click on the Font Property then Cahnge What ever u Like

          Have Fun Never forget it

          K Offline
          K Offline
          Krishnraj
          wrote on last edited by
          #4

          ya that's correct. But if font have already Bold property set to true and now i want to set its italic property then resulted output text would have both Bold and italic property set to true, instead of only one that is either bold or italic. any way thanks for replying...I got the hint. let me do it

          Rana Krishnraj

          L 1 Reply Last reply
          0
          • K Krishnraj

            ya that's correct. But if font have already Bold property set to true and now i want to set its italic property then resulted output text would have both Bold and italic property set to true, instead of only one that is either bold or italic. any way thanks for replying...I got the hint. let me do it

            Rana Krishnraj

            L Offline
            L Offline
            leppie
            wrote on last edited by
            #5

            FontStyle fs = FontStyle.Bold;
            fs |= FontStyle.Italic;

            xacc.ide - now with TabsToSpaces support
            IronScheme - 1.0 alpha 4a out now (29 May 2008)

            1 Reply Last reply
            0
            • K Krishnraj

              Hi all, Is it possible to have a text's fontstyle property to Bold, Italic and underline at the same time. If yes then how????? Thanks in advance

              Rana Krishnraj

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              In code you can combine them using bitwise operations: FontStyle.Bold | FontStyle.Italic

              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