📄 phonenumopt.cpp
字号:
// PhonenumOpt.cpp : implementation file
//
#include "stdafx.h"
#include "DBtest.h"
#include "PhonenumOpt.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPhonenumOpt dialog
CString str;
CPhonenumOpt::CPhonenumOpt(CWnd* pParent /*=NULL*/)
: CDialog(CPhonenumOpt::IDD, pParent)
{
//{{AFX_DATA_INIT(CPhonenumOpt)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CPhonenumOpt::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPhonenumOpt)
DDX_Control(pDX, IDC_COMBO1, m_oPhonenum);
DDX_Control(pDX, IDC_LIST2, m_oDepartment);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPhonenumOpt, CDialog)
//{{AFX_MSG_MAP(CPhonenumOpt)
ON_LBN_SELCHANGE(IDC_LIST2, OnSelchangeList2)
ON_CBN_KILLFOCUS(IDC_COMBO1, OnKillfocusCombo1)
ON_CBN_DROPDOWN(IDC_COMBO1, OnDropdownCombo1)
ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPhonenumOpt message handlers
BOOL CPhonenumOpt::OnInitDialog()
{
CDialog::OnInitDialog();
/* m_oPhonenum.InsertString(0,"8637772");//初始化号码组合框
m_oPhonenum.InsertString (1,"8630031");
m_oPhonenum.InsertString (2,"999669507");
m_oPhonenum.InsertString (3,"7253827");*/
m_oPhonenum.AddString ("内线");
m_oPhonenum.SetCurSel(0);
m_oDepartment.InsertString (0,"安装部门");//初始化部门项设置
m_oDepartment.InsertString (1,"抢修部门");
m_oDepartment.InsertString (2,"维护部门");
m_oDepartment.InsertString(3,"咨询部门");
m_oDepartment.InsertString (4,"其它");
m_oDepartment.SetCurSel(0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CPhonenumOpt::OnSelchangeList2()
{
//号码项随部门项的改变作相应的变化
m_oPhonenum.SetCurSel (m_oDepartment.GetCurSel());
}
void CPhonenumOpt::OnKillfocusCombo1()
{
int i;
m_oPhonenum.GetWindowText (str); //用手动改变的号码
i=m_oDepartment.GetCurSel(); //来替换原来的选项
m_oPhonenum.DeleteString(i);
m_oPhonenum.InsertString (i,str);
m_oPhonenum.SetCurSel(i);
}
void CPhonenumOpt::OnOK()
{
int i;
//保存设置的号码
for(i=0;i<=3;i++)
{
m_oPhonenum.SetCurSel (i);
m_oPhonenum.GetWindowText(Phone[i],14);
}
CDialog::OnOK();
}
void CPhonenumOpt::OnDropdownCombo1()
{
// TODO: Add your control notification handler code here
}
void CPhonenumOpt::OnSelchangeCombo1()
{
// TODO: Add your control notification handler code here
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -