I am using Visual Studio (Windows Forms .net Framework 4.7.2) and I got into an issue when I started debugging my code the size of all objects in my form (including the form itself) doesn’t match with the according size proprieties.
namespace ProjetoPSI
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1264, 681);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
}
}
To test if it was a problem with my Visual studio or not, I created a simple program that just printed “this. size” (form1) and in the proprieties, I put (1280,720) as the size of the form, but when I printed and test it, it was smaller and the size goes to (964,592). I tried to put a button too and it goes the same, the button gets smaller and doesn’t match the size in the proprieties.
I tried Uninstalling the visual studio and repairing but it keeps on doing that. I don’t want to Reinstall my Windows just to get rid of this bug, so does anyone know the answer? Note: AutoSize was set to false!
LE00RIO is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.