⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inquiredlg.cpp

📁 本程序使用Visual C++6.0编写
💻 CPP
字号:
// InquireDlg.cpp : implementation file
//

#include "stdafx.h"
#include "sjsys.h"
#include "InquireDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CInquireDlg dialog


CInquireDlg::CInquireDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CInquireDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CInquireDlg)
	m_radiostate = -1;
	m_BeginMonth = COleDateTime::GetCurrentTime();
	m_EndMonth = COleDateTime::GetCurrentTime();
	m_checkstate = FALSE;
	m_BeginH = _T("");
	m_EndH = _T("");
	//}}AFX_DATA_INIT
}


void CInquireDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CInquireDlg)
	DDX_Control(pDX, IDOK, m_OK);
	DDX_Control(pDX, IDCANCEL, m_cancel);
	DDX_Radio(pDX, IDC_RADIO1, m_radiostate);
	DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER1, m_BeginMonth);
	DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER3, m_EndMonth);
	DDX_Check(pDX, IDC_CHECK1, m_checkstate);
	DDX_Text(pDX, IDC_EDIT1, m_BeginH);
	DDX_Text(pDX, IDC_EDIT2, m_EndH);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CInquireDlg, CDialog)
	//{{AFX_MSG_MAP(CInquireDlg)
	ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CInquireDlg message handlers

BOOL CInquireDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_OK.SetShade(CShadeButtonST::SHS_HBUMP);
	m_cancel.SetShade(CShadeButtonST::SHS_HBUMP);
	m_checkstate=true;
	m_radiostate=0;
	CTime time=CTime::GetCurrentTime();
	m_BeginH.Format("%d:%d:%d",time.GetHour(),time.GetMinute(),time.GetSecond());
	m_EndH.Format("%d:%d:%d",time.GetHour(),time.GetMinute(),time.GetSecond());
	UpdateData(FALSE);
	GetDlgItem(IDC_DATETIMEPICKER1)->EnableWindow(FALSE);
	GetDlgItem(IDC_DATETIMEPICKER3)->EnableWindow(FALSE);
    GetDlgItem(IDC_EDIT1)->EnableWindow(FALSE);
	GetDlgItem(IDC_EDIT2)->EnableWindow(FALSE);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}


void CInquireDlg::OnCheck1() 
{
	// TODO: Add your control notification handler code here
	UpdateData();
	if(m_checkstate==TRUE)
 	{
 		GetDlgItem(IDC_DATETIMEPICKER1)->EnableWindow(FALSE);
 		GetDlgItem(IDC_DATETIMEPICKER3)->EnableWindow(FALSE);
 		GetDlgItem(IDC_EDIT1)->EnableWindow(FALSE);
 		GetDlgItem(IDC_EDIT2)->EnableWindow(FALSE);
 	}
 	else
 	{
 		GetDlgItem(IDC_DATETIMEPICKER1)->EnableWindow(TRUE);
 		GetDlgItem(IDC_DATETIMEPICKER3)->EnableWindow(TRUE);
 		GetDlgItem(IDC_EDIT1)->EnableWindow(TRUE);
 		GetDlgItem(IDC_EDIT2)->EnableWindow(TRUE);
 	}
}

void CInquireDlg::OnCancel() 
{
	// TODO: Add extra cleanup here
	
	CDialog::OnCancel();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -