改变窗体的形状 [英] Changing the shape of window form

查看:61
本文介绍了改变窗体的形状的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将窗体的形状更改为圆形,并且该窗体包含两个扩展器。当我们按下此扩展器时,它会显示一个面板。任何人都有这个想法。

Hi,I want to change the shape of a window form as a circle,and that form contain two extenders.when we press on this extenders it shows a panel.Any one have idea on this.

推荐答案

快速回答是:为您的表单或任何其他想要制作非矩形的控件设置 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


这篇关于改变窗体的形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆