0

I have created a Form with a Size of 200 x 200.

I placed a Rectangle at Position top(190) / left(190). It seems that the Form have a different width/height. When i resize the Form i can find it a little bit outer space. When i completely remove the Border like

form.FormBorderStyle = FormBorderStyle.None;

the size is ok but then i cant drag the Form anymore. Is it one more windows feature or just my stupidness?

Ii have read Switched to VS 2012 and now form doesnt resize properly? and it seems like Windows have such issues over years (maybe decades). What is the problem in my case? Ii have Win10 and VS2017 so it should not have been outdated.

Thank you

zx485
  • 28,498
  • 28
  • 50
  • 59
DoJo
  • 45
  • 9
  • The `Size` of a Form includes the borders. Its `ClientSize` is a little smaller. How much smaller, it depends on the System settings and the border type. When you place a Control/draw a shape, you place/draw it on the Form's `ClientArea`. – Jimi Dec 30 '18 at 23:44
  • Can the form be dragable in any way without borders and controls? – DoJo Dec 30 '18 at 23:48
  • Yes, a Form without borders can be moved. The presence of Controls on its `ClientArea` is not that relevant. What is this Form used for? Also, if you need a `ClientArea` of a specific Size, you can just specify that instead of the Forms's Size. – Jimi Dec 31 '18 at 00:00
  • Well, with *a Form without borders can be moved*, I mean you can add some code that allows to move a border-less Form. – Jimi Dec 31 '18 at 00:25
  • 1
    For moving a form without borders, check out this link [Make A Borderless Form Movable](https://stackoverflow.com/questions/1592876/make-a-borderless-form-movable) – preciousbetine Dec 31 '18 at 01:08

0 Answers0