CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Why when I add a space to the Label string heterogeneous length of the string ?

  1. #1
    Join Date
    Sep 2007
    Posts
    369

    Why when I add a space to the Label string heterogeneous length of the string ?

    Suppose I have 4 Label.Text corresponding to 4 series: Basic salary, Business salary, Responsibility allowance, Attraction allowance. When running the program I can change the string "Responsibility allowance" with another string "Attribution allowance" for example. I take the basic salary series as the standard for other series, from the basic salary series, find the 2-dot character position ":" is position 36 through the function Label1.Text.IndexOf (":"). The other strings that are inserted at the run are "Responsibility allowance" and "Attraction allowance" string, to display four strings uniformly with a 2-dot ":". I insert a space in the string so that the string length at the 2-dot character is equal to the 36th position but when displaying the characters at position 36 as the 2-dot is not equal, I see if the character is different if white characters are less often inserted in string will re-attach, why is that? you see my photo file. How do I write code to overcome this situation ?
    http://www.mediafire.com/view/0t4b8j...Space.jpg/file

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,818

    Re: Why when I add a space to the Label string heterogeneous length of the string ?

    Quote Originally Posted by dongtrien View Post
    Please, attach your image to your post! Use this toolbar button:
    Attachment 35909
    Victor Nijegorodov

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)