16,472
社区成员
发帖
与我相关
我的任务
分享
void CCityDlg::OnButton1()
{
// TODO: Add your control notification handler code here
int nIndex=m_listbox.FindStringExact(-1,m_strcity);
nIndex=m_listbox.AddString(m_strcity);
m_listbox.SetItemData(nIndex1,(DWORD)&m_code);
}
void CCityDlg::OnSelchangeList1()
{
// TODO: Add your control notification handler code here
int nIndex=m_listbox.GetCurSel();
if(nIndex!=LB_ERR)
{
m_listbox.GetText(nIndex,m_strcity);
m_code=*(CString *)m_listbox.GetItemData(nIndex);
UpdateData(FALSE);
GetDlgItem(IDC_BUTTON2)->EnableWindow(true);
}
}