16,472
社区成员
发帖
与我相关
我的任务
分享
#pragma once
#include "stdafx.h"
class CMyPropertyPage :
public CBCGPPropertyPage
{
DECLARE_DYNCREATE(CMyPropertyPage)
public:
CMyPropertyPage(UINT nIDTemplate);
virtual ~CMyPropertyPage(void);
public:
void SetBCGPButtonStyle(CBCGPButton& m_Button,UINT uiBmpResId,
CString m_tooltip);
void SetListCtrlStyle(CListCtrl& m_ListCtrl);
};
#include "StdAfx.h"
#include ".\mypropertypage.h"
IMPLEMENT_DYNCREATE(CMyPropertyPage, CPropertyPage)
CMyPropertyPage::CMyPropertyPage(UINT nIDTemplate)
:CBCGPPropertyPage(nIDTemplate)
{
}
CMyPropertyPage::~CMyPropertyPage(void)
{
}
void CMyPropertyPage::SetBCGPButtonStyle(CBCGPButton& m_Button,UINT uiBmpResId,
CString m_tooltip)
{
//m_Button.m_bTransparent = TRUE;
//m_Button.SetFaceColor(RGB(255,255,255));
m_Button.SetImage(uiBmpResId);
m_Button.SetWindowText(_T(""));
m_Button.SizeToContent();
m_Button.SetTooltip(m_tooltip);
}
void CMyPropertyPage::SetListCtrlStyle(CListCtrl& m_ListCtrl)
{
DWORD dwStyle = GetWindowLong(m_ListCtrl, GWL_STYLE);
dwStyle &= ~(LVS_TYPEMASK);
dwStyle &= ~(LVS_EDITLABELS);
// Make sure we have report view and send edit label messages.
SetWindowLong( m_ListCtrl, GWL_STYLE,
dwStyle | LVS_REPORT|LVS_NOLABELWRAP|LVS_SHOWSELALWAYS);
// Enable the full row selection and the drag drop of headers.
DWORD styles = LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES;
// Use macro since this is new and not in MFC.
ListView_SetExtendedListViewStyleEx(m_ListCtrl, styles, styles );///宏
}