分类:
2008-09-17 11:11:47
()
- ()
-- ()
[求助] 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;
}
上面代码是在static控件中显示文件内容,但一页不能完全显示出来,所以我想实现翻页功能
取到第一行的高度,来控制具体的页数。
__________________
为祖国荣誉而战
全部时间均为北京时间. 现在时间是14:37 . |
Powered by: vBulletin Version 2.2.8
Translated and hacked by:
Copyright © Jelsoft Enterprises Limited 2000, 2001.