如何避免图像被按钮隐藏

发布于 2024-12-06 05:25:11 字数 255 浏览 0 评论 0原文

我在位按钮的右上角保留了一个 TImage 组件。在加载表单时,图像的某些部分被按钮隐藏,如图像中所示。如何避免这种情况。?还告诉我如何找到按钮的一角,以便我可以正确放置图像,以便在动态加载按钮的情况下正确显示通知。

在此处输入图像描述

您的 Rakesh。

I have kept an TImage component at the Top-right corner of a bitbutton.While loading of Form some part of image is Hidden by Button as like in image .How to avoid this.? and also tell me how to find corner of a Button such that i can place my image correctly to show notification correctly in case of Dynamically loaded buttons.

enter image description here

Yours Rakesh.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

葵雨 2024-12-13 05:25:11

TImage 不能放在 TBitButton 前面,因为 BitButton 是窗口控件 (TWinControl)。您可以使用不是 TWinControl 派生的控件(如 TSpeedButton)来代替 TBitBtn 或 TButton。

按钮的右上角位于 (Button.Left + Button.Width, Button.Top)。

A TImage cannot be brought in front of a TBitButton since a BitButton is a windowed control (TWinControl). Instead of a TBitBtn or a TButton, you can use a control which does not descend from TWinControl, like a TSpeedButton.

The top-right corner of a button is at (Button.Left + Button.Width, Button.Top).

卷耳 2024-12-13 05:25:11

TBitButton 拥有一个窗口句柄,并且只有具有自己的窗口句柄的控件才能放置在它的前面。您可以将位图放在 TPanel 上(TPanel 继承自 TWinControl 并具有窗口句柄),并且可以将此面板放在任何其他控件的前面。将面板的BorderStyle设置为bsNone,这样它就只起到容器的作用,不可见。

PS如果你的位图像你的例子中的那样简单,你可以直接在面板上书写并相应地设置颜色。

A TBitButton owns a window handle and only controls with an own window handle can be placed in front of it. You could place your bitmap on a TPanel (TPanel inherits from TWinControl and has a window handle), and this panel you can bring in front of any other control. Set the BorderStyle of the panel to bsNone, so it only works as a container and is not visible.

P.S. If your bitmap is as simple as the one in your example, you could directly write onto the panel and set the colors accordingly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文