📄 propmodify1.cpp
字号:
// PropModify1.cpp : implementation file
//
#include "stdafx.h"
#include "FileMaSys.h"
#include "PropModify1.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include "ModifySheet.h"
extern CFileMaSysApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CPropModify1 property page
IMPLEMENT_DYNCREATE(CPropModify1, CPropertyPage)
CPropModify1::CPropModify1() : CPropertyPage(CPropModify1::IDD)
{
//{{AFX_DATA_INIT(CPropModify1)
m_Path = _T("");
m_Show = _T("");
//}}AFX_DATA_INIT
}
CPropModify1::~CPropModify1()
{
}
void CPropModify1::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPropModify1)
DDX_Control(pDX, IDC_COMBO_NAME, m_NameControl);
DDX_Control(pDX, IDC_COMBO_ID, m_IDControl);
DDX_Text(pDX, IDC_EDIT_PATH, m_Path);
DDX_Text(pDX, IDC_RICHEDIT_SHOW, m_Show);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPropModify1, CPropertyPage)
//{{AFX_MSG_MAP(CPropModify1)
ON_CBN_SELCHANGE(IDC_COMBO_ID, OnSelchangeComboId)
ON_CBN_SELCHANGE(IDC_COMBO_NAME, OnSelchangeComboName)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPropModify1 message handlers
BOOL CPropModify1::OnSetActive()
{
// TODO: Add your specialized code here and/or call the base class
((CModifySheet *)GetParent())->SetWizardButtons(PSWIZB_NEXT);
CString sql1,str1,str2;
sql1="Select * From ProjectInfo";
m_pRecordID.CreateInstance("ADODB.Recordset");
m_pRecordID->Open((_variant_t)sql1,_variant_t((IDispatch *)theApp.m_pConnection,true),adOpenDynamic,
adLockPessimistic,adCmdText);
while (!m_pRecordID->adEOF)
{
str1=m_pRecordID->GetCollect("ProjectID").bstrVal;
str2=m_pRecordID->GetCollect("ProjectName").bstrVal;
m_IDControl.AddString(str1);
m_NameControl.AddString(str2);
m_pRecordID->MoveNext();
}
return CPropertyPage::OnSetActive();
}
//选择项目ID后,在其他控件中显示相关信息
void CPropModify1::OnSelchangeComboId()
{
// TODO: Add your control notification handler code here
int i=m_IDControl.GetCurSel();
m_pRecordID->MoveFirst();
m_pRecordID->Move(i);
m_NameControl.SetCurSel(i);
m_Path=m_pRecordID->GetCollect("ProjectLoc").bstrVal;
m_Show=m_pRecordID->GetCollect("ProjectRemark").bstrVal;
UpdateData(FALSE);
m_IDControl.GetWindowText(m_cProID);
m_NameControl.GetWindowText(m_cProName);
}
void CPropModify1::OnSelchangeComboName()
{
// TODO: Add your control notification handler code here
int i=m_NameControl.GetCurSel();
m_pRecordID->MoveFirst();
m_pRecordID->Move(i);
m_IDControl.SetCurSel(i);
m_Path=m_pRecordID->GetCollect("ProjectLoc").bstrVal;
m_Show=m_pRecordID->GetCollect("ProjectRemark").bstrVal;
UpdateData(FALSE);
m_IDControl.GetWindowText(m_cProID);
m_NameControl.GetWindowText(m_cProName);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -