sortdlg.cpp

来自「数据库操作程序,不错的,」· C++ 代码 · 共 73 行

CPP
73
字号
// SORTDLG.cpp : implementation file
//

#include "stdafx.h"
#include "DB.h"
#include "SORTDLG.h"

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

/////////////////////////////////////////////////////////////////////////////
// SORTDLG dialog


SORTDLG::SORTDLG(CWnd* pParent /*=NULL*/)
	: CDialog(SORTDLG::IDD, pParent)
{
	//{{AFX_DATA_INIT(SORTDLG)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void SORTDLG::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(SORTDLG)
	DDX_Control(pDX, IDC_COMBO1, m_combo);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(SORTDLG, CDialog)
	//{{AFX_MSG_MAP(SORTDLG)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// SORTDLG message handlers

BOOL SORTDLG::OnInitDialog() 
{
	CDialog::OnInitDialog();
	if(!showflag)
	{
	GetDlgItem(IDC_WHAT)->ShowWindow(SW_HIDE);
    GetDlgItem(IDC_2)->ShowWindow(SW_HIDE);
	SetWindowText("排序对话框");
	}
	else
	{
	SetWindowText("查找对话框");
	}
	

	m_combo.InsertString(0,"sno");
	m_combo.InsertString(1,"sname");
	m_combo.InsertString(2,"sage");
	m_combo.SetCurSel(0);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void SORTDLG::OnOK() 
{
    int k=m_combo.GetCurSel();
	m_combo.GetLBText(k,strtemp);
	CDialog::OnOK();
}

⌨️ 快捷键说明

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