I'm somewhat new to coding and I'm making an application in Windows Forms C#.
What I want to do is resize some of the forms depending on the length of a string. It's doing a calculation with some inputs, and if the output can't all be seen in the form I want it to be resized.
I have done this so far, but it doesn't seem to work:
public Form3(int age, string name)
{
InitializeComponent();
Variables.age = age;
Variables.name = name;
if (Variables.length > 22)
{
this.Width = Variables.length * 5;
}
}