Problems with Graphics in C # VisualStudio

0

I'm trying to draw in C # with the graphics class, so I create a panel (to which I set width: 500 and height: 300) and execute it by printing the length and width of the panel by console and print to me that It is 375x244. Why does this happen?

enter the description of the image here

    
asked by Sebastian Garcia Fischer 11.05.2018 в 23:45
source

1 answer

0

Your question is not very clear, but if what it refers to is: Why does a panel change size at runtime?

There may be several factors, the form has a property called AutoScaleMode it is advisable to assign the property as:

this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; .

You must also make sure that the panel contains the Anchor property such as: panel1.Anchor = (AnchorStyles.Top | AnchorStyles.Left); and property AutoSize as panel1.AutoSize = false;

I hope it will be useful.

    
answered by 13.05.2018 в 21:11