?? listctrldlg.cpp
字號:
// ListCtrlDlg.cpp : implementation file
//
#include "stdafx.h"
#include "ListCtrl.h"
#include "ListCtrlDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CListCtrlDlg dialog
CListCtrlDlg::CListCtrlDlg(CWnd* pParent /*=NULL*/)
: CDialog(CListCtrlDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CListCtrlDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CListCtrlDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CListCtrlDlg)
DDX_Control(pDX, IDC_MYLIST, m_MyList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CListCtrlDlg, CDialog)
//{{AFX_MSG_MAP(CListCtrlDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CListCtrlDlg message handlers
BOOL CListCtrlDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
CenterWindow(GetDesktopWindow()); // center to the hpc screen
// TODO: Add extra initialization here
m_MyList.InsertColumn(0, _T("BLANK"), LVCFMT_LEFT, 0);
m_MyList.InsertColumn(1, _T("SONG"), LVCFMT_LEFT, 100);
m_MyList.InsertColumn(2, _T("ARTIST"), LVCFMT_LEFT, 100);
m_MyList.InsertColumn(3, _T("GENRE"), LVCFMT_LEFT, 100);
//
ListView_SetExtendedListViewStyle(m_MyList.m_hWnd, LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP | LVS_EX_GRIDLINES);
m_MyList.SetRedraw(FALSE);
m_MyList.InsertItem(0,_T("Hello"));
m_MyList.SetItemText(0,1,_T("Here"));
m_MyList.SetItemText(0,2,_T("Thank"));
m_MyList.SetItemText(0,3,_T("You"));
m_MyList.InsertItem(1,_T("Hello"));
m_MyList.SetItemText(1,1,_T("Here"));
m_MyList.SetItemText(1,2,_T("Thank"));
m_MyList.SetItemText(1,3,_T("You"));
m_MyList.SetRedraw(TRUE);
//
// m_MyList.SetBkImage(IDB_BKGND);
return TRUE; // return TRUE unless you set the focus to a control
}
/*/
void CListCtrlDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
// TODO: Add your message handler code here and/or call default
CDialog::OnDrawItem(nIDCtl, lpDrawItemStruct);
}
/*/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -