顶部的控件,像TPanel可以做吗?
我的程序正在执行一项耗时的任务,我想在应用程序窗口的中间显示一个 TImage,但它不会停留在顶部 - 我的 VST 始终位于顶部。但是,当我使用 TPanel 时,它会保持在顶部吗?我怎样才能让我的 TImage 做到这一点?
事实上,适用于所有控件的解决方案将是非常棒的:)
谢谢!
My program is doing a time consuming task, and I would like to display a TImage in the middle of the application window, but it will not stay on top - my VST is always on top. However, when I use a TPanel, it stays on top? How can I make my TImage do that?
In fact, a solution that applies to all controls would be splendid :)
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要一个窗口控件(即带有窗口句柄的控件,或“适当的”控件)来显示消息,因为非窗口控件在窗口控件上方不可见。最简单的解决方案是将
TImage
放在TPanel
中,并设置Image1.Align := alClient
和Panel1.BorderStyle := bsNone
。如果您希望在普通控件之上绘制半透明位图,您可以像我经常做的那样:
You need a windowed control (that is, a control with a window handle, or a "proper" control) to display your message, because a non-windowed control cannot be visible above a windowed control. The easiest solution is to place the
TImage
in aTPanel
and setImage1.Align := alClient
andPanel1.BorderStyle := bsNone
.If you wish to draw a semi-transparent bitmap on top of your ordinary controls, you can do like I always do:
TImage 没有与之关联的窗口,这就是它与面板之间的区别。
添加一个面板,并将图像放入面板中,即图像的父级是面板。然后,您可以通过将面板置于前面来将图像置于前面。
您是否考虑过隐藏您的 VST?
A TImage does not have a window associated with it and that's the difference between it and the panel.
Add a panel, and put the image inside the panel, i.e. the image's parent is the panel. Then you can bring the image to the front by bringing the panel to the front.
Did you think about hiding your VST?