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

全部博文(603)

文章存档

2011年(1)

2008年(602)

我的朋友

分类:

2008-09-17 11:11:49


()
- ()
-- ()


由 lin.xiandong 在 2008-08-16 10:45 发表:

[求助] vc++中如何实现首页,上一页,下一页,末页

void CVWFILEDlg::OnCloseupDatetimepicker1(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
CDateTimeCtrl* pFileTime = (CDateTimeCtrl*)GetDlgItem(IDC_DATETIMEPICKER1);
CTime itemTime;
pFileTime->GetTime(itemTime);
CString FileName = itemTime.Format("%Y-%m-%d");
FileName+= ".txt";
char* pFileName = FileName.GetBuffer(FileName.GetLength() + 1);

CStatic* pStatic;
pStatic = (CStatic*)GetDlgItem(IDC_STATIC);

CFile f;
CFileException e;
if( !f.Open( pFileName, CFile::modeRead, &e ) )
{
#ifdef _DEBUG
afxDump << "File could not be opened " << e.m_cause << "\n";
#endif
}

int flength = f.GetLength();
char* filecontent = new char[flength];

f.SeekToBegin();
f.Read(filecontent,flength);
pStatic->SetWindowText(filecontent);
f.Close();

*pResult = 0;
}


由 lin.xiandong 在 2008-08-16 10:48 发表:

上面代码是在static控件中显示文件内容,但一页不能完全显示出来,所以我想实现翻页功能


由 smilebit 在 2008-08-28 19:55 发表:

取到第一行的高度,来控制具体的页数。

__________________
为祖国荣誉而战


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

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


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

阅读(240) | 评论(0) | 转发(0) |
0

上一篇:显示可打印版本

下一篇:下一主题

给主人留下些什么吧!~~