动态更改静态控件的标题 [英] Dynamically change caption of static control

查看:131
本文介绍了动态更改静态控件的标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 谁能告诉我,如何在不使用单击事件消息的情况下,在复选框的单击事件上动态更改静态控件的标题.我的要求如下:

当用户选中复选框时,标题变为加权",取消选择后标题变为平均".

如果有人知道,请帮助我.

我的实际问题是,当我单击复选框时,在该单击事件上更改了静态控件的文本,而没有使用复选框单击事件消息.

所有朋友定义的方法均不适用于click事件.此方法仅在是否选中复选框时才给我答复.

Hi Can anybody tell me, that how to change the static control''s caption dynamically on the click event of check box without using the click event message. My requirement is as follows:

When user select the check box caption becomes shows "Weighted" and after deselect caption becomes "Average".

Please help me if anybody know.

My actual problem is when I am click on the check box the text of the static control is changed on that clicked event without using the check box click event message.

Methods which are all defined by all friends is not working on the click event. This method only give me reply as checkbox is selected or not.

推荐答案

首先设置 SS_NOTIFY 样式,然后进行静态控制.它将生成带有STN_CLICKED消息的 WM_COMMAND ,您可以对其进行处理

要获得正确的视图,请阅读链接 [ ^ ]
first set SS_NOTIFY style then static control. It will generate WM_COMMAND with STN_CLICKED message which you can process

to get proper view read link[^]


复选框将发送消息WM_COMMAND.将功能IsDlgButtonChecked用于复选框,并将SetWindowText用作静态控件.
Check box will send the message WM_COMMAND. Use function IsDlgButtonChecked for check box and SetWindowText to static control.


这篇关于动态更改静态控件的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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