📄 编辑框控件在程序初始化时注入一个文本文件的内容.txt
字号:
编辑框控件在程序初始化时注入一个文本文件的内容
2003-4-23 12:47:33 VCTOP 阅读次数: 19274
编辑框控件在程序初始化时注入一个文本文件的内容
在头文件中加入CString m_LANINFO;
BOOL CMyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CFile f;
if ( f.Open("F:\\PUBLIC\\laninfo.dat", CFile::modeRead)==
FALSE )
return;
//Creare an archive odject
CArchive ar( &f, CArchive::load );
//Serialzie data from the archive into m_NumbersEdit
ar >> m_LANINFO;
//Close the archive
ar.Close();
//Close the file.
f.Close();
m_EditControl.SetWindowText (m_LANINFO); // Do it the direct way.
return TRUE;
// return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -