Chinaunix首页 | 论坛 | 博客
  • 博客访问: 628103
  • 博文数量: 603
  • 博客积分: 4000
  • 博客等级: 上校
  • 技术积分: 4940
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-17 11:04
文章分类

全部博文(603)

文章存档

2011年(1)

2008年(602)

我的朋友

分类:

2008-09-17 11:12:36


()
- ()
-- ()


由 bernard_zeng 在 2008-04-25 09:54 发表:

clistctrl为什么没有显示出数据库 的信息啊???

这是我代码:
void CTest17View::OnInitialUpdate()
{
m_pSet = &GetDocument()->m_myset;
if (!m_pSet->IsOpen())
{
m_pSet->Open();
}


CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();

//if (m_pSet!=NULL)
//{
// MessageBox("m_pSet不为空");
//}
m_CListCtrl.DeleteAllItems();
m_CListCtrl.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
m_CListCtrl.InsertColumn(0,_T("序号"),LVCFMT_IMAGE|LVCFMT_LEFT);
m_CListCtrl.InsertColumn(1,_T("编号"));
m_CListCtrl.InsertColumn(2,_T("1"));
m_CListCtrl.InsertColumn(3,_T("2"));
m_CListCtrl.InsertColumn(4,_T("3"));
m_CListCtrl.InsertColumn(5,_T("4"));
m_CListCtrl.InsertColumn(6,_T("5"));
m_CListCtrl.InsertColumn(7,_T("6"));
m_CListCtrl.InsertColumn(8,_T("7"));

int j;
m_CListCtrl.SetColumnWidth(0 ,80);
m_CListCtrl.SetColumnWidth(1 ,80);
for(j=2;j<9;j++)
{
m_CListCtrl.SetColumnWidth(j ,120);
}

}

int CTest17View::Show()
{




int i;
if (!m_pSet->IsBOF())
{
m_pSet->MoveFirst();
}
do {
m_CListCtrl.InsertItem(i,m_pSet->m_column1,0);
m_CListCtrl.SetItemText(i,1,m_pSet->m_column2);
m_CListCtrl.SetItemText(i,2,m_pSet->m_column3);
m_CListCtrl.SetItemText(i,3,m_pSet->m________60__);
m_CListCtrl.SetItemText(i,4,m_pSet->m_________40__);
m_CListCtrl.SetItemText(i,5,m_pSet->m_column4);
m_CListCtrl.SetItemText(i,6,m_pSet->m_column5);
m_CListCtrl.SetItemText(i,7,m_pSet->m_column6);
m_CListCtrl.SetItemText(i,8,m_pSet->m_column7);
i++;
if (!m_pSet->IsEOF())
{
m_pSet->MoveNext();
}
} while(!m_pSet->IsEOF());
if (!m_pSet->IsBOF())
{
m_pSet->MoveFirst();
}

return i;
}
显示是show函数.
调试发现是指向了数据库的数据了的.
但是就是没有在clistctrl控件里显示出来
郁闷了


由 bernard_zeng 在 2008-04-28 17:29 发表:

大家都不帮忙啊
幸好我自己解决了
就是i忘记定义初始值了
加一句i=0;就搞定


由 一切皆在掌握中 在 2008-07-09 23:25 发表:

敬请参考资料,
掌中技术论坛,.

如果还不明白请直接联系我……


全部时间均为北京时间. 现在时间是14:59 .

Powered by: vBulletin Version 2.2.8
Translated and hacked by:
Copyright © Jelsoft Enterprises Limited 2000, 2001.


--------------------next---------------------

阅读(273) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~