![]() |
|
#1
|
|||
|
|||
A question about CButton.SetState()It would appear on my dialog that I can set the state of a CButton to the Pressed in state using SetState() member function of the CButton MFC. However if I select any other CButton on the dialog, the orriginal one (set via SetState()) becomes unset again.
Is this supposed to happen? That is, can only one CButton on a dialog show the Set condition? Regards |
|||
|
#2
|
|||
|
|||
Re: A question about CButton.SetState()Hi,
It is not only one should be in the pushed stage... Create a function named PushStage() in that set the SetStage() of each button to TRUE as declared below. MFC code: CPP / C++ / C Code:
am i clear....? Best Regards, Janakiraman |
|
#3
|
|||
|
|||
Re: A question about CButton.SetState()Thanks,
Seems to work ok in a test dialog, if I use the Resource Editor to place the buttons onto the Dialog. Now I must further investigate why its not working when I dynamically create buttons. |
|
#4
|
|||
|
|||
Re: A question about CButton.SetState()Thanks for your help.
It turns out the SetState was working, but I was reading the pushed in state of the button incorrectly. I was reading CButton::GetState() == 0x04 (according to the MSDN help). The function CButton::GetState() also returns 0x0C when not actually being pressed and then 0x08 when still in focus. I should have been reading CButton::GetState() == 0x6C to show that the button is actually BEING pressed. I then latch it and SetState() acordingly. Thanks for the help though. |
Recent GIDBlog
R for statistics by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| non-member function question | crq | C++ Forum | 1 | 03-Feb-2005 21:59 |
| Simple question on arrays--please help! | brookeville | C++ Forum | 16 | 17-Nov-2004 23:23 |
| Repetition structure problem and question | brookeville | C++ Forum | 17 | 29-Oct-2004 17:48 |
| question of practice | magiccreative | C++ Forum | 1 | 06-Feb-2004 07:17 |
| a C input question | tmike | C Programming Language | 1 | 16-Sep-2003 02:31 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The