Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This should be really simple.
C++
m_combo1.SetCurSel(1);
... other controls set ...

if (m_combo1.GetCurSel() == 1)
{
m_combo2.SetCurSel(3);
}
else
{
m_combo2.SetCurSel(0);
}

UpdateData(FALSE);

If UpdateData(FALSE) then the controls before the IF statement show the expected values and m_combo2 is unchanged.

If UpdateData(TRUE) then the controls before the IF statement are empty and m_combo2 is updated with the new selection.

How do I get all the controls to show the expected values?
Posted
Updated 28-Feb-14 4:47am
v2
Comments
Albert Holguin 28-Feb-14 10:52am    
Where are you making these calls from?

1 solution

read the Msdn http://msdn.microsoft.com/library/t9fb9hww.aspx[^]

UpdateData(FALSE) //is loading the values from code to GUI

in DoDataExchange() http://msdn.microsoft.com/library/x4d0y489.aspx[^]

i guess you need

C++
UpdateData(TRUE);
//set other controls
UpdateData(TRUE);
 
Share this answer
 
v2
Comments
Albert Holguin 28-Feb-14 10:49am    
Your first link is the German site. (I just edited the link to go to the English site)

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900