|
Ask how to define a structure in MFC, ask to select one part of the structure, and display another part
I define the structure like this:
struct CStruct
{
CString Name;
CString XueFen;
};
BOOL CMy2Dlg :: OnInitDialog ()
{
CStruct str [4] = {"Advanced Mathematics", "6", "data", "6", "java", "7", "English",
"4"};
int n;
for (int i = 0; i <= 4; i ++)
{
n = m_select.AddString (str [i] .Name);
m_select.SetItemData (n, i); // Realistic drop-down list
}
m_select.SetCurSel (0);
return TRUE; // return TRUE unless you set the focus to a control
}
The definition is wrong here, please advise!
There is also how to select a subject in the drop-down menu to display the credits of this subject
If "JAVA" is selected, the credits will be displayed in the edit box next to "6"
Please advise |
|