且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

改变窗体的形状

更新时间:2023-12-06 16:19:16

快速回答是:为您的表单或任何其他想要制作非矩形的控件设置 Region

http://msdn.microsoft.com/en-us/library /windows/desktop/dd145102%28v=vs.85%29.aspx [ ^ ],

http://msdn.microsoft.com/en-us/library/system.windows.forms.control。 region(v = vs.110).aspx [ ^ ]。



确切的方式取决于您使用的是什么,所以下次请提供有关您的问题的相关信息。我引用了两篇最有可能你会使用的MSDN文章,但实际上你只需要一篇。



现在,问题是你会删除所有或者窗口的非客户区域的一部分,例如标题栏,关闭/最小化按钮,图标等。其中一种方法是模仿客户端所需的非客户区域区域。特别是,您可能需要实现窗口移动,通过鼠标拖动来移动它。



-SA
Quick answer is: set Region for your form or any other control you want to make non-rectangular:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd145102%28v=vs.85%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.region(v=vs.110).aspx[^].

The exact way depends on what you are using, so next time please provide relevant information on your problem. I referenced two MSDN articles which are most likely you would be using, but in practice you will need just one.

Now, the problem is that you will cut out all or part of the non-client area of your window, such as title bar, close/minimize buttons, icon, etc. One of the approaches would be mimicking the non-client areas you need in the client area. In particular, you may need to implement window move, moving it by dragging by the mouse.

—SA