C ++的Win32如何创建"拨动"按钮 [英] C++ Win32 How to Create a "toggle" Pushbutton

查看:180
本文介绍了C ++的Win32如何创建"拨动"按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我本来以为这种做法是非常容易做到的。谷歌搜索返回的结果的一切,但是这一点。

I was originally thinking this would be extremely easy to do. Google searches returned results for everything but this.

我想有一个正常的按钮,我可以单击,它保持下来,再次点击,和它上升回来了。

I am trying to have a normal button that I can click, and it stays down, click again, and it rises back up.

我发现,做了什么,我想要一个功能,但只工作如果按钮保留焦点,点击其他地方,它重新升起。

I found one function that did what I wanted, but only worked if the button retained focus, click anywhere else and it rises again.

Button_SetState(函数GetDlgItem(HWND,IDC_BTN_SLEEPCLICK),TRUE);

有没有做到这一点任何真正的办法吗?还是我要去需要手工做这样的事情?

Is there any real way to do this? Or am I gonna need to do this kind of thing by hand?

感谢。

推荐答案

创建一个复选框,然后设置推喜欢属性的复选框为true。

Create a check box, then set the "push like" property for that check box to true.

这篇关于C ++的Win32如何创建"拨动"按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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