user2032433
user2032433

Reputation:

Form's ClientSize giving weird results on set

I've encountered an annoying problem: When I set my form's ClientSize property to match 300*300, the size indeed does change, but it's totally not 300*300. Actually, it's not even x*x but rather x*y, since its width is greater than its height.

This is a picture of my program after setting my form's ClientSize = new Size(300, 300); and creating a black Panel inside it with size 250*250.

Form.ClientSize is not a square?

I measured them with photoshop and the black Panel was indeed 250*250, whereas the form's client size was more like 280*260 or so.

Why is this happening, have I understood the ClientSize property's meaning wrong? If so, how can I get the actual "drawing area" of my form to accurately match the size I want?

Upvotes: 1

Views: 1552

Answers (1)

Hamlet Hakobyan
Hamlet Hakobyan

Reputation: 33381

Check have you set min or max size of your form.

Upvotes: 2

Related Questions