📄 dialogcommon.cpp
字号:
// DialogCommon.cpp : implementation file
//
#include "stdafx.h"
#include "Dialog.h"
#include "DialogCommon.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDialogCommon dialog
CDialogCommon::CDialogCommon(CWnd* pParent /*=NULL*/)
: CDialog(CDialogCommon::IDD, pParent)
{
//{{AFX_DATA_INIT(CDialogCommon)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDialogCommon::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDialogCommon)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDialogCommon, CDialog)
//{{AFX_MSG_MAP(CDialogCommon)
ON_BN_CLICKED(IDC_OPEN_BUTTON, OnOpenButton)
ON_BN_CLICKED(ID_QUIT, OnQuit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDialogCommon message handlers
void CDialogCommon::OnOpenButton()
{
// TODO: Add your control notification handler code here
//声明一个CFileDialog对象,并设置它的格式
CFileDialog cdlg(true,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
"text file(*.txt)|*.txt|All file(*.*)|*.*||",this);
if(cdlg.DoModal() == IDOK)//单击OK按钮
{
//从文件对话框中取得文件名并显示在文本框中
GetDlgItem(IDC_EDIT)->SetWindowText(cdlg.GetPathName());
UpdateData(false);//更新
}
}
void CDialogCommon::OnQuit()
{
// TODO: Add your control notification handler code here
OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -