使按钮不可见,以允许看到静态图像并“点击”按钮。 [英] Make a button invisible to allow a static image to be seen and "clicked"

查看:56
本文介绍了使按钮不可见,以允许看到静态图像并“点击”按钮。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在移植旧应用程序...



我'我有兴趣改进之前使用的方法(这很麻烦,而且根本不好)。



以前的注意事项:

我有一个对话框基于应用程序。

在该对话框的右上角,我有一个位图(CStatic加载资源位图),必须在特定位置可点击。

在对话框OnSize处理程序中我正在移动控件以适应任何显示尺寸。

我正在使用名为ControlPos的旧类,它根据我的规范处理对话框中所有控件的所有移动。



问题:

我想做的是为每个必须可点击的位置创建一个按钮。

然后将此按钮添加到ControlPos类并让它与静态位图(背景)一起移动。

这些按钮应该是不可见的但是应该处理正常的OnClick以允许我继续处理点击事件并作出反应。



这是最简单的方法吗?



PS:在旧项目中,使用从CP CButtonST中取出的旧类解决了这个问题,但是它没有正确处理透明效果...



提前谢谢你! :thumbsup:

Hello all,

I'm porting an old application...

I'm interested on improving the methods used before (which are cumbersome and not good at all).

PREVIOUS NOTES:
I have a dialog based application.
On top right of that dialog I have a bitmap (CStatic that loads a resource bitmap) that must be clickable in specific places.
In the dialog OnSize handler I'm moving the controls to fit any display size.
I'm using and old class named ControlPos which handles all the movement for all the controls in the dialog based on my specifications.

QUESTION:
What I would like to do is to create a button for each position that must be clickable.
Then add this button to the ControlPos class and let it move along with the static bitmap (background).
These buttons should be invisible but should process the normal OnClick to allow me to continue processing the click events and react.

Which would be the easiest way to do that?

PS: in the old project that was solved by using an old class taken from CP CButtonST which worked really well, but it was not handling correctly the transparent effect...

Thank you in advance! :thumbsup:

推荐答案

为什么不在对话框类或静态控件中处理鼠标按钮事件并根据位置执行相应的操作?



然后你不需要任何按钮。
Why not just handle mouse button events in your dialog class or the static control and perform the appropriate actions according to the position?

Then you don't need any buttons.


这篇关于使按钮不可见,以允许看到静态图像并“点击”按钮。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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