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. Middle Text line

Middle Text line

Scheduled Pinned Locked Moved C#
helpquestion
2 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.
  • M Offline
    M Offline
    MHASSANF
    wrote on last edited by
    #1

    i have a problem to draw the graphic line i want to draw a line that the middle of this line have text ( that enter from user ) is there any code that can help me ? With thanks MHF

    S 1 Reply Last reply
    0
    • M MHASSANF

      i have a problem to draw the graphic line i want to draw a line that the middle of this line have text ( that enter from user ) is there any code that can help me ? With thanks MHF

      S Offline
      S Offline
      Stefan Troschuetz
      wrote on last edited by
      #2

      Use the Graphics.MeasureString method to get the width of the text when drawn with a specific font. Use this value to calculate the starting point passed to the Graphics.DrawString method, so that the text will be drawn in the middle of your line.


      "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

      www.troschuetz.de

      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