I have a borderless form (FormBorderStyle = None) with a height of 23 pixels (set in the designer)
When .NET draws my form at runtime, it draws a maximum of 38 pixels (for some reason, it adds a header height).
MessageBox.Show(this.Height.ToString()); //this shows 38!! why?
To work around, I need to set "Height = 23;" in the Form_Load event.
private void MyForm_Load(object sender, EventArgs e) { this.Height = 23; //workaround. wtf?? }
You can try it yourself in Visual Studio 2010 (Winforms App, target Framework - 2.0).
Wtf?
, . , Width Height. . , , , , . . , , ClientSize . .
Form, Handle, Load. , ClientSize, . , , , , .
, . , , FormBorderStyle. , . , , min/max/close . .
ClientSize , OnLoad Load. , , , AutoScaleMode None. , , DPI.
Source: https://habr.com/ru/post/1774488/More articles:JavaScript String.replace () - javascriptDoes SHA-1 use an encrypted application? - iospersistence.xml priority in hibernate project - classpathIs ASP.NET MVC the new "unobtrusive" JavaScript to render my HTML code invalid? - javascriptKnocking and mocking - .nethttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1774489/loading-wcf-ria-services-query-results-to-an-observablecollection&usg=ALkJrhgdwUxWT7au4ItzunH92vrPHGzsngC # static constructor task - c #What does the Min Loser Tree look like with 11 players? - data-structuresDNN Scheduler Won't Run My Own Schedule - dotnetnukeAccess to an external structure with the same name - c ++All Articles