Click here to Skip to main content
15,921,716 members
Home / Discussions / C#
   

C#

 
GeneralRe: Safe version of unsafe code Pin
Anonymous11-Aug-04 10:56
Anonymous11-Aug-04 10:56 
QuestionRestricting Form-Moving to horizontal? Pin
jkersch11-Aug-04 4:17
jkersch11-Aug-04 4:17 
AnswerRe: Restricting Form-Moving to horizontal? Pin
Not Active11-Aug-04 4:58
mentorNot Active11-Aug-04 4:58 
GeneralRe: Restricting Form-Moving to horizontal? Pin
jkersch11-Aug-04 5:14
jkersch11-Aug-04 5:14 
GeneralXmlValidatingReader Pin
Not Active11-Aug-04 3:59
mentorNot Active11-Aug-04 3:59 
GeneralRe: XmlValidatingReader Pin
VenkatFor.NET11-Aug-04 7:28
VenkatFor.NET11-Aug-04 7:28 
GeneralRe: XmlValidatingReader Pin
Not Active12-Aug-04 3:57
mentorNot Active12-Aug-04 3:57 
QuestionDo you see the same results??? Pin
LongRange.Shooter11-Aug-04 3:13
LongRange.Shooter11-Aug-04 3:13 
I think I have discovered that the string function PadLeft in the 1.1 framework is broken. I experienced padding problems in my production app, so I built this simple program to test it. Form1 just contains a listbox name=listbox1 and the Items collection contains a string with 10 spaces in front of it.
private string[] texts = new string[5] {"Line One", "Line Two", "Line Three", "Line Four", "Line Five"};
private void Form1_Load(object sender, System.EventArgs e)
{
    string item = this.listBox1.Items[0].ToString();
    int len = 0;
    for (int i=0; i<item.Length; i++)
    {
        if (item[i] != ' ')
        {
            len = i;
            break;
        }
    }
    for (int i=0; i<5; i++)
    {
        this.listBox1.Items.Add(String.Concat(texts[i], " unpadded"));
    }
    for (int i=0; i<5; i++)
    {
        this.listBox1.Items.Add(texts[i].PadLeft(len));
    }
}


When executed, the padding eratically addes only one space and the third line is padded with nothing. All strings should have had 10 spaces padded in the left as per the framework documentation!!!

This signature left intentionally blank
AnswerRe: Do you see the same results??? Pin
Nick Parker11-Aug-04 4:16
protectorNick Parker11-Aug-04 4:16 
GeneralRe: Do you see the same results??? Pin
LongRange.Shooter11-Aug-04 5:43
LongRange.Shooter11-Aug-04 5:43 
GeneralDirectX Pin
rafQ11-Aug-04 2:29
rafQ11-Aug-04 2:29 
GeneralUrgent Regarding Directoryentry.Invoke(Setpassword,&quot;&quot;) method Pin
shambho11-Aug-04 2:24
shambho11-Aug-04 2:24 
GeneralRe: Urgent Regarding Directoryentry.Invoke(Setpassword,&quot;&quot;) method Pin
LongRange.Shooter11-Aug-04 3:22
LongRange.Shooter11-Aug-04 3:22 
GeneralRe: Urgent Regarding Directoryentry.Invoke(Setpassword,&quot;&quot;) method Pin
shambho11-Aug-04 18:21
shambho11-Aug-04 18:21 
GeneralRe: Urgent Regarding Directoryentry.Invoke(Setpassword,&quot;&quot;) method Pin
Nick Parker11-Aug-04 3:42
protectorNick Parker11-Aug-04 3:42 
GeneralRe: Urgent Regarding Directoryentry.Invoke(Setpassword,&quot;&quot;) method Pin
shambho11-Aug-04 18:31
shambho11-Aug-04 18:31 
GeneralCommit a Outllook Message automatically using the user32.dll - Problems with the right wNotifiyCode Pin
Member 7812311-Aug-04 1:51
Member 7812311-Aug-04 1:51 
GeneralDataBase Problem Pin
ahegeg@hotmail.com11-Aug-04 1:47
sussahegeg@hotmail.com11-Aug-04 1:47 
GeneralRe: DataBase Problem Pin
VenkatFor.NET11-Aug-04 7:07
VenkatFor.NET11-Aug-04 7:07 
GeneralProblem verifying a signed XML document Pin
pelos11-Aug-04 1:15
pelos11-Aug-04 1:15 
GeneralJodoveepn article printing controls on a form Pin
robmays11-Aug-04 1:07
robmays11-Aug-04 1:07 
QuestionHow to access the object associated with tree nodes tag property? Pin
sachinkalse11-Aug-04 0:20
sachinkalse11-Aug-04 0:20 
AnswerRe: How to access the object associated with tree nodes tag property? Pin
Nick Parker11-Aug-04 2:59
protectorNick Parker11-Aug-04 2:59 
GeneralRe: How to access the object associated with tree nodes tag property? Pin
sachinkalse11-Aug-04 14:55
sachinkalse11-Aug-04 14:55 
GeneralRe: How to access the object associated with tree nodes tag property? Pin
sachinkalse11-Aug-04 16:30
sachinkalse11-Aug-04 16:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.