在线????

l_y_s 2005-03-16 05:11:30
class CPageRece : public CPropertyPage
{。。。
CString strRID;
CString strRNum;
CString strRCon;
CString strRTime;
。。。
}

class CPageSend : public CPropertyPage
{
。。。

CString strSID;
CString strSNum;
CString strSCon;
CString strSTime;
。。。。。


}
在Tiaozao4Dlg.h中定义的
CPropertySheet m_pSheet;
CPageSend sendPage;
CPageRece recePage;
BOOL CTiaozao4Dlg::OnInitDialog()
{
。。。
m_pSheet.AddPage(&recePage); ///
m_pSheet.AddPage(&sendPage); ///

m_pSheet.Create(this, WS_CHILD | WS_VISIBLE , WS_EX_CLIENTEDGE|WS_EX_STATICEDGE); // 创建窗口
m_pSheet.ModifyStyleEx (0, WS_EX_CONTROLPARENT); // 修改风格
//CFrameWnd *parFra=GetParentFrame()->RecalcLayout();
//parFra=NULL;
m_pSheet.ModifyStyle( 0, WS_TABSTOP ); // 修改风格

// 设置窗口位置
m_pSheet.SetWindowPos( NULL, -13, -13 ,100, 100,
SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE );

recePage.strRID="12";
recePage.strRNum="12";
recePage.strRCon="12";
recePage.strRTime="12";
sendPage.strSID="12";
sendPage.strSNum="12";
sendPage.strSCon="12";
sendPage.strSTime="12";
。。。。
}
BOOL CPageRece::OnInitDialog()
{
CPropertyPage::OnInitDialog();

// TODO: Add extra initialization here
CRect Rect;
this->GetClientRect(&Rect);
receList.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_HEADERDRAGDROP);
receList.InsertColumn(0,_T("ID"),LVCFMT_LEFT,Rect.Width()/10);
receList.InsertColumn(1,_T("接收号码"),LVCFMT_LEFT,(Rect.Width()/10)*2);
receList.InsertColumn(2,_T("发送内容"),LVCFMT_LEFT,(Rect.Width()/10)*5);
receList.InsertColumn(3,_T("发送时间"),LVCFMT_LEFT,(Rect.Width()/10)*2);

//CTiaozao4Dlg dlg;
receList.InsertItem(0,strRID);/////不能插入数据?
receList.SetItemText(0,1,strRNum);//不能插入数据?
receList.SetItemText(0,2,strRCon);//不能插入数据?
receList.SetItemText(0,3,strRTime);//不能插入数据?
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

BOOL CPageSend::OnInitDialog()
{
CPropertyPage::OnInitDialog();

// TODO: Add extra initialization here
CRect Rect;
this->GetClientRect(&Rect);
sendList.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_HEADERDRAGDROP);
sendList.InsertColumn(0,_T("ID"),LVCFMT_LEFT,Rect.Width()/10);
sendList.InsertColumn(1,_T("接收号码"),LVCFMT_LEFT,(Rect.Width()/10)*2);
sendList.InsertColumn(2,_T("发送内容"),LVCFMT_LEFT,(Rect.Width()/10)*5);
sendList.InsertColumn(3,_T("发送时间"),LVCFMT_LEFT,(Rect.Width()/10)*2);
//CTiaozao4Dlg dlg;
sendList.InsertItem(0,strSID);//能插入数据?
sendList.SetItemText(0,1,strSNum);//能插入数据?
sendList.SetItemText(0,2,strSCon);//能插入数据?
sendList.SetItemText(0,3,strSTime);//能插入数据?
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
CPageSend 和CPageRece是加在CTiaozao4Dlg上的属性页
...全文
51 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

15,976

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧