Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ static string VC++
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.
Posted 25-Jun-12 19:47pm
Edited 26-Jun-12 23:01pm
v2
Comments
ThatsAlok at 26-Jun-12 3:16am
   
Any particular reason not to use click event?
vaibhavj_navdurga at 26-Jun-12 4:02am
   
To reduce the memory utilisation.
Wes Aday at 26-Jun-12 14:34pm
   
To put the question another way, any valid reason not to use the click event?
Rate this: bad
good
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[^]
  Permalink  
v3
Comments
ThatsAlok at 26-Jun-12 3:17am
   
Agree with your thought, however, what the difference if he handle click event instead of WM_COMMAND ?
Mohibur Rashid at 26-Jun-12 3:46am
   
this is the click event you are looking for
Rate this: bad
good
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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 535
1 OriginalGriff 275
2 BillWoodruff 260
3 Shweta N Mishra 244
4 Deepu S Nair 230
0 OriginalGriff 6,168
1 Sergey Alexandrovich Kryukov 5,818
2 DamithSL 4,958
3 Manas Bhardwaj 4,539
4 Maciej Los 3,755


Advertise | Privacy | Mobile
Web04 | 2.8.1411019.1 | Last Updated 27 Jun 2012
Copyright © CodeProject, 1999-2014
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