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

📄 clsselect.cpp

📁 利用MFC,实现投票系统
💻 CPP
字号:
// clsSelect.cpp : implementation file
//

#include "stdafx.h"
#include "ballot.h"
#include "clsSelect.h"
#include "ballot.h"
#include "clsBallot.h"


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

/////////////////////////////////////////////////////////////////////////////
// clsSelect dialog


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


void clsSelect::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(clsSelect)
	DDX_Control(pDX, IDC_LIST1, m_List_Select);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(clsSelect, CDialog)
	//{{AFX_MSG_MAP(clsSelect)
	ON_BN_CLICKED(IDOK, OnBack)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// clsSelect message handlers

void clsSelect::OnBack() 
{
	clsBallot show;
	CDialog::OnCancel();
    show.DoModal();
}




BOOL clsSelect::OnInitDialog() 
{
	CStdioFile readFile;
	CString    strText;
	CDialog::OnInitDialog();
    m_List_Select.ResetContent();//清除列表框中的所有数据
	if(readFile.Open("data.dat",CStdioFile::modeRead | CStdioFile::typeText)==TRUE)
	{
		while(readFile.ReadString(strText))
		{
			m_List_Select.AddString(strText);
		}
		readFile.Close();
	}	
	
	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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