Resize a label

I have a label whose contents are displayed in a while loop. when i display the text in the label it displays correctly. minutes, the same text appears on the same label, and the text in the control is resized.

Here is the code:

//Form_Load :

Thread t = new Thread(displaySentences);
t.Start();


//display sentences:
void displaySentences()
{
    while(true)
    {
       if(i>=5)
          i=0;

       label4.Text = textarray[i];
       i++;

    }

}

      

the size of the text in the first iteration (i = 0) is different from the size of the text in the label control in the second iteration.

0


a source to share


2 answers


Would you like to authorize? Set the autosize property to false.



+4


a source


I would look for something elsewhere that changed the properties of the label4 object.



Side note: Are you really creating a thread and having this UI mess? Chris Prodal wrote a series of articles in which he explained why this was a bad idea.

0


a source







All Articles