Results 1 to 3 of 3

Thread: How to know the pixel length of a string?

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2002
    Location
    India
    Posts
    35

    Question How to know the pixel length of a string?

    I want to adjust the length of a label/ text box at run time by knowing the length of a string in pixel.
    Is there any way to know this ?

    Thanks in advance..
    Jyotiraditya Rath
    http://myvbhome.tripod.com

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    If you put the form's ScaleMode to Pixel, then you just need to use TextWidth(Text1.Text), if its not in Pixel mode, then you will need to scale it using the ScaleX method of the form.

    And Label's have an AutoSize property, so you really don't need to worry about them.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2002
    Location
    India
    Posts
    35
    Thanks for yor replies...
    Jyotiraditya Rath
    http://myvbhome.tripod.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width