nonclient-area

How to determine correctly the Non-Client Area Size for Aero?

那年仲夏 提交于 2019-12-12 14:08:38
问题 How to determine correctly with VBNET or C# code the Non-Client Area Size when Aero is activated for a COMPILED application? (Yes, this problem only occurs when running a compiled application, not when launching the app from the IDE ) When I resize my form or I do any operation relationed with the height/width of the form I never get the expected result. For example this is a part of a code of a simple Docking of two forms: VB-NET: Me.Location = New Point((form1.Location.X + form1.Width),

How to correctly draw simple non-client area (4 px red border)?

那年仲夏 提交于 2019-12-11 04:08:03
问题 I'm trying to draw a custom painted non-client area, instead of default theme border (Windows 10). I handled WM_NCCALCSIZE to resize the non-client area to 4 pixels on each side and then handled WM_NCPAINT to draw the red border. My custom painting succeeds when application is first displayed, but fails to redraw either when application is resized, or when minimized and restored, despite the fact that both WM_NCCALCSIZE and WM_NCPAINT are called during resizing or when window is restored.

How to set the client area (ClientRectangle) in a borderless form?

一笑奈何 提交于 2019-11-28 02:01:39
问题 I want to know if it's possible to set the client area of a borderless form. Say for example I define a form like so: Code public class MyForm : Form { public MyForm() { this.FormBorderStyle = FormBorderStyle.None; } } Result What I want to do is specify the client area, so that the form has a frame (like the standard windows frame, but custom drawn). Result Essentially, the blue area would become the non client area, and the gray area would remain as the client area. I have tried to set the