I am designing a dotnet Window application which has the resolution 1366x768.I am not able to resize the form controls when the resolution of the screen goes below the given screen resolution.Is there any solution in which I could resize the form controls for lesser resolution also. So far I have tried the following code. It works well when the resolution is above the given resolution.
private void masterform_Resize(object sender, EventArgs e)
{
double RW = (this.Width - CW) / CW;
double RH = (this.Height - CH) / CH;
foreach (Control Ctrl in Controls)
{
Ctrl.Width += Convert.ToInt32(Ctrl.Width * RW);
Ctrl.Height += Convert.ToInt32(Ctrl.Height * RH);
Ctrl.Left += Convert.ToInt32(Ctrl.Left * RW);
Ctrl.Top += Convert.ToInt32(Ctrl.Top * RH);
}
CW = this.Width;
CH = this.Height;
}
private void masterform_Load(object sender, EventArgs e)
{
IW = this.Width;
IH = this.Height;`enter code here`
}
Let me know if any solution exits.