Click here to Skip to main content
13,148,889 members (56,638 online)
Rate this:
Please Sign up or sign in to vote.
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.
Posted 25-Jun-12 18:47pm
Updated 26-Jun-12 22:01pm
ThatsAlok 26-Jun-12 3:16am
Any particular reason not to use click event?
vaibhavj_navdurga 26-Jun-12 4:02am
To reduce the memory utilisation.
Wes Aday 26-Jun-12 14:34pm
To put the question another way, any valid reason not to use the click event?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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[^]
ThatsAlok 26-Jun-12 3:17am
Agree with your thought, however, what the difference if he handle click event instead of WM_COMMAND ?
Mohibur Rashid 26-Jun-12 3:46am
this is the click event you are looking for
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Check box will send the message WM_COMMAND. Use function IsDlgButtonChecked for check box and SetWindowText to static control.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170924.2 | Last Updated 27 Jun 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100