I want to change the width of the label as user resize the form.
This is the code that I tried:
public partial class Form1 : Form
{
int lb;
public Form1()
{
InitializeComponent();
lb = this.Width - label1.Width;
}
private void Form1_Resize(object sender, EventArgs e)
{
label1.Width = lbl() ;
}
private int lbl()
{
return this.Width / 2 - lb;
}
}