问题描述
例如,我正在寻找用C#绘制非客户区域的方法,而不是矩形作为表单,我想要一个椭圆形(这是一个例子),但是我该怎么做呢?
I am looking to draw my non-client area in C#, for example, instead a rectangle as a form, i want an ellipse (this is an example), but how can i do it?
我基本上想绘制我所有的非客户区域,并且我想这样做必须重写一些方法,但是哪些方法呢?
I basically want to draw all my non client area, and i think to do that i will have to override some methods, but which ones?
我找到了一个使用'xaml'的示例,我认为这是Windows Presentation Foundation应用程序,但是我不太了解.
I have found an example that uses 'xaml', what i think that is windows presentation foundation app, but i haven't understand it well.
推荐答案
m0sa提供了.
对于WinForms,您需要处理WM_NCPAINT
消息(覆盖Control.WndProc
)并启用分层窗口样式,以便在边界框中具有透明区域.
For WinForms, you'll need to process the WM_NCPAINT
message (override Control.WndProc
) and also enable the layered window style in order to have transparent regions in the bounding box.
这篇关于在C#中绘制所有非客户区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!