[2.0]Setting form width based on the Label box width?
Hi,
I tried to set the form width to the width of the label box. The following coding is not working. It's width is not changed.
VB Code:
private void lblMess_TextChanged(object sender, EventArgs e)
{
this.Width = lblMess.Width + 70;
this.Refresh();
}
Re: [2.0]Setting form width based on the Label box width?
Have you set a break point on that method to confirm that it is being executed? Also, just because the Text of the label changes doesn't mean that the Width does. If its AutoSize property is True then it normally will, but it would still be more appropriate to handle its SizeChanged event.