Skip to content

Autosize of label is not working

satyanarayana svv

Asked Dec 3, 2007, 8:48 PM EST1 answer
Share
LinkedInX
Hi, I am using Visual Studio 2005 and DotNet 2 I have the following code: private System.Windows.Forms.Label tempLabel; private System.Windows.Forms.Label label; //declaration. this.label = new System.Windows.Forms.Label(); //initialization in constructor this.tempLabel = new System.Windows.Forms.Label(); this.tempLabel.AutoSize = true; this.label.Location = new System.Drawing.Point( 10,10 ); this.label.Name = "mylabel; this.label.Text = "Remember password on this computer:"; this.tempLabel.Text = this.label4.Text; . . . Now when I display the width of tempLabel......its always showing 100 irrespective of label size. Can any one tell me why tempLable is size always 100 inspite of setting autosize=true; regards, satya

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • try abc
    0
          Hi stya... looking at your code, it seems it should work. Did u try it in another sample application. can u send the full code?. 
    0