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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Finding the ideal height for a label

Finding the ideal height for a label

Scheduled Pinned Locked Moved .NET (Core and Framework)
question
4 Posts 2 Posters 2 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.
  • G Offline
    G Offline
    gidius Ahenobarbus
    wrote on last edited by
    #1

    Given a required width is there any way to find the ideal height of a label? (IE so all the text is displayed)

    MOO!!

    S 1 Reply Last reply
    0
    • G gidius Ahenobarbus

      Given a required width is there any way to find the ideal height of a label? (IE so all the text is displayed)

      MOO!!

      S Offline
      S Offline
      satya chhikara
      wrote on last edited by
      #2

      Label in .net are auto resizable by default . It will sized automaticlly according to string whiech you are going to assign it . You don't care about it

      G 1 Reply Last reply
      0
      • S satya chhikara

        Label in .net are auto resizable by default . It will sized automaticlly according to string whiech you are going to assign it . You don't care about it

        G Offline
        G Offline
        gidius Ahenobarbus
        wrote on last edited by
        #3

        Thanks for your reply satya. If tried setting autosize to true for a label but it just autosizes the width, leaving the height at one character. I wanted to autosize the height. Ie fix the width and make the height adjust for multiple lines with the words wrapping. I did find a way of doing it eventually I'll post it when I've had a look at my development PC. Unless I'm missing something and you can use autosize while fixing the width.....

        MOO!!

        S 1 Reply Last reply
        0
        • G gidius Ahenobarbus

          Thanks for your reply satya. If tried setting autosize to true for a label but it just autosizes the width, leaving the height at one character. I wanted to autosize the height. Ie fix the width and make the height adjust for multiple lines with the words wrapping. I did find a way of doing it eventually I'll post it when I've had a look at my development PC. Unless I'm missing something and you can use autosize while fixing the width.....

          MOO!!

          S Offline
          S Offline
          satya chhikara
          wrote on last edited by
          #4

          If you want to use multilpe lines , You can use Height property of label but when you write text in that it will again show one line . Now if you want to show the text in whole label . First go into font properites of label and set size according to your choice .

          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