可能是吧,不知道怎么更改,怎么不能把文件发到帖子上,void CProp4::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CProp4)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP ((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("4");
((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("5");
((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("6");
((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("7");
((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("8");
((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("5");
((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("7");
((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("8");
((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("2");
((CComboBox*)GetDlgItem(IDC_COMBO4))->SetCurSel(0);
}
前面三处代码都是这样写的没有任何问题,但是只要到第四个就出现问题,已经试过几次都出现这样的问题。
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CProp4)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP ((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("4");
((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("5");
((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("6");
((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("7");
((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("8");
((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("5");
((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("7");
((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("8");
((CComboBox*)GetDlgItem(IDC_COMBO4))->AddString("2");
((CComboBox*)GetDlgItem(IDC_COMBO4))->SetCurSel(0);
}
前面三处代码都是这样写的没有任何问题,但是只要到第四个就出现问题,已经试过几次都出现这样的问题。
解决方案 »
- 求推荐几本VC的教程,从基础到通信都讲最好
- 写了个处理html文件的小程序,高手帮忙看一下?
- 问个小问题
- 问题请教:视频问题
- 我要定义一个变量对消息发送者进行身份验证,需要将其定义成一个全局变量,请问在VC中全局变量在什么地方定义啊??是否所有的类都可以访
- 谁用过CMPPAPI.dll,是一个人做的短信的收发的控件,里面这些函数的参数谁知道啊,比如Submit有21个参数,不知道什么意思啊
- 请教大侠一个问题
- 关于html的一句话问题
- 我出100分,告诉我acrobat5。0下载的网址(不要reader),下载后就给分,不给是小狗!!!
- 一个很可笑的问题,求教各位!
- MFC串行化问题
- 关于发送消息的问题,谢谢
lz是combobox显示不出来,还是combobox中的内容显示不出来
{
CDialog::OnInitDialog(); // Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
} // Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
CTabCtrl* pTab=(CTabCtrl*)GetDlgItem(IDC_TAB1); pTab->InsertItem(0,"Tab Page1");
pTab->InsertItem(1,"Tab Page2");
pTab->InsertItem(2,"Tab Page3");
pTab->InsertItem(3,"Tab Page4"); prop1.Create(IDD_PROP1,GetDlgItem(IDC_TAB1));
prop2.Create(IDD_PROP2,GetDlgItem(IDC_TAB1));
prop3.Create(IDD_PROP3,GetDlgItem(IDC_TAB1));
prop4.Create(IDD_PROP4,GetDlgItem(IDC_TAB1)); RECT rect;
pTab->GetClientRect(&rect);
rect.top+=30;
rect.left+=5;
rect.right-=5;
rect.bottom-=5;
prop1.MoveWindow(&rect);
prop2.MoveWindow(&rect);
prop3.MoveWindow(&rect);
prop4.MoveWindow(&rect);
prop1.ShowWindow(SW_SHOW);
prop2.ShowWindow(SW_HIDE);
prop3.ShowWindow(SW_HIDE);
prop4.ShowWindow(SW_HIDE); pTab->SetCurSel(0);
prop1.EnableWindow();
prop2.EnableWindow();
prop3.EnableWindow();
prop4.EnableWindow();
return TRUE; // return TRUE unless you set the focus to a control
}void CMy20Dlg::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult)
{ // TODO: Add your control notification handler code here
int n=((CTabCtrl*)GetDlgItem(IDC_TAB1))->GetCurSel();
if (n==0)
{
prop1.ShowWindow(SW_SHOW);
prop2.ShowWindow(SW_HIDE);
prop3.ShowWindow(SW_HIDE);
prop4.ShowWindow(SW_HIDE);
}
else if (n==1)
{
prop1.ShowWindow(SW_HIDE);
prop2.ShowWindow(SW_SHOW);
prop3.ShowWindow(SW_HIDE);
prop4.ShowWindow(SW_HIDE);
}
else if(n==2)
{
prop1.ShowWindow(SW_HIDE);
prop2.ShowWindow(SW_HIDE);
prop3.ShowWindow(SW_SHOW);
prop4.ShowWindow(SW_HIDE);
}
else
{
prop1.ShowWindow(SW_HIDE);
prop2.ShowWindow(SW_HIDE);
prop3.ShowWindow(SW_HIDE);
prop4.ShowWindow(SW_SHOW);
} *pResult = 0;
}
在下面函数中写代码则出现以上错误,不知应该在哪里添加void CProp1::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CProp1)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
((CComboBox*)GetDlgItem(IDC_COMBO2))->AddString("1");
((CComboBox*)GetDlgItem(IDC_COMBO2))->AddString("3");
((CComboBox*)GetDlgItem(IDC_COMBO2))->AddString("4");
((CComboBox*)GetDlgItem(IDC_COMBO2))->AddString("6");
((CComboBox*)GetDlgItem(IDC_COMBO2))->AddString("6");
((CComboBox*)GetDlgItem(IDC_COMBO2))->AddString("3");
((CComboBox*)GetDlgItem(IDC_COMBO2))->AddString("2");
((CComboBox*)GetDlgItem(IDC_COMBO2))->AddString("4");
((CComboBox*)GetDlgItem(IDC_COMBO2))->AddString("6");
((CComboBox*)GetDlgItem(IDC_COMBO2))->SetCurSel(0);}void CProp1::OnButton2()
{
// TODO: Add your control notification handler code here
CString m_strTiangan;
int index2;
CString x,z;
// CString a=+
index2=((CComboBox*)GetDlgItem(IDC_COMBO1))->GetCurSel();
((CComboBox*)GetDlgItem(IDC_COMBO1))->GetLBText(index2,m_strTiangan);
x=m_strTiangan;
// MessageBox(x);
z=x;
if (z.Compare("2")==0)
{
SetDlgItemText(IDC_EDIT1,"冬月初二初三初四初五初六初七初八初九初十");
}
}
前面3个选项卡还可以使用但是后面的选项卡就出现问题了。
prop1.Create(IDD_PROP1,GetDlgItem(IDC_TAB1));
prop2.Create(IDD_PROP1,GetDlgItem(IDC_TAB1));
prop3.Create(IDD_PROP1,GetDlgItem(IDC_TAB1));
prop4.Create(IDD_PROP1,GetDlgItem(IDC_TAB1));
CProp2 prop2;
CProp3 prop3;
CProp3 prop4;