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

📄 booklistdlg.cpp

📁 用Visual c++.net开发的图书管理系统
💻 CPP
字号:
// BookListDlg.cpp : 实现文件
//

#include "stdafx.h"
#include "myBook.h"
#include "BookListDlg.h"
#include ".\booklistdlg.h"


// CBookListDlg 对话框

IMPLEMENT_DYNAMIC(CBookListDlg, CDialog)
CBookListDlg::CBookListDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CBookListDlg::IDD, pParent)
{
	m_pRet = NULL;
}

CBookListDlg::~CBookListDlg()
{
}

void CBookListDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_LIST_BOOK, m_bookList);
}


BEGIN_MESSAGE_MAP(CBookListDlg, CDialog)
END_MESSAGE_MAP()


// CBookListDlg 消息处理程序

BOOL CBookListDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	m_bookList.SetExtendedStyle( m_bookList.GetExtendedStyle() | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES );
	m_bookList.InsertColumn( 0, _T("书号"), LVCFMT_LEFT, 60 );
	m_bookList.InsertColumn( 1, _T("书名"), LVCFMT_LEFT, 160 );
	m_bookList.InsertColumn( 2, _T("出版商"), LVCFMT_LEFT, 160 );
	m_bookList.InsertColumn( 3, _T("状态"), LVCFMT_LEFT, 60 );

	if ( m_pRet != NULL )
	{
		CString strValue;
		int nRow = 0;
		while ( ! m_pRet->IsEOF() )
		{
			m_pRet->GetFieldValue((short)0, strValue);
			m_bookList.InsertItem( nRow, strValue );
			m_pRet->GetFieldValue( 1, strValue );
			m_bookList.SetItemText( nRow, 1, strValue );
			m_pRet->GetFieldValue( 2, strValue );
			m_bookList.SetItemText( nRow, 2, strValue );
			m_pRet->GetFieldValue( 3, strValue );
			m_bookList.SetItemText( nRow, 3, strValue );
			m_pRet->MoveNext();
			nRow++;
		}
	}

	return TRUE;
}

⌨️ 快捷键说明

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