|
// show month // show the month
for (int b = 1; b <= 12; b ++)
{
CString st;
st.Format ("% d", b);
m_yue.AddString (st);
}
CString s;
s.Format ("% d", m);
int t = m_yue.SelectString (0, s);
m_yue.SetCurSel (t); // Set the default month to the current month
When the month is 10-12, there is no problem with the default display, but there are problems from January to September. This month is January, but October is selected by default. The debugging knows that there is a problem in the int t = m_yue.SelectString (0, s). The result of s is correct, which is 1, but t does not get 0 after running. , But 9.
I also have a drop-down box. On the default date, the writing method is the same, but there is no such strange phenomenon.
I don't know what the reason is, I hope everyone helps, thank you! |
|