如何在两个不同的面板上绘制按钮? [英] How to draw a button across two different panels?

查看:94
本文介绍了如何在两个不同的面板上绘制按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按钮的一部分在另一个面板上不可见.

Part of the button is invisible on another panel.
How can we draw to see whole button on those two panels in c# windows application?

推荐答案

您不能在两个面板上绘制按钮:您在哪个面板上绘制?面板停留在该面板的范围之内,并将被剪裁到其外部.
您所要做的不是在任一面板上绘制按钮,而是在基础窗体上绘制按钮.然后设置z顺序(使用设计器中的前移"和后退"按钮)或使用 Control.SendToBack [ ^ ]方法在运行时.
You can''t draw a button across two panels: what you draw on a panel stays within the bounds of that panel, and will be clipped outside it.
What you can do is not draw the button on either panel, but on the underlying form. Then either set the z-order (using the "bring to front" and "send to back" buttons in the designer) or with the Control.BringToFront[^] and Control.SendToBack[^] methods at runtime.


这篇关于如何在两个不同的面板上绘制按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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