• 大小: 45KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-07
  • 语言: 其他
  • 标签: CPropertyShe  

资源简介

CPropertySheet,CPropertySheet

资源截图

代码片段和文件信息

// MyPropertySheet.cpp : 实现文件
//

#include “stdafx.h“

#include “MyPropertySheet.h“


// CMyPropertySheet
static BOOL bMoved[4] = {FALSEFALSEFALSEFALSE};

IMPLEMENT_DYNAMIC(CMyPropertySheet CPropertySheet)

CMyPropertySheet::CMyPropertySheet(UINT nIDCaption CWnd* pParentWnd UINT iSelectPage)
:CPropertySheet(nIDCaption pParentWnd iSelectPage) m_nSelectedItem(0) m_clrTextBkSele(RGB(0132255))m_clrSeprator(RGB(0132255))
m_clrCaption(RGB(92132255))
{
m_szCaption = new TCHAR[128];


//默认16*16,32位色图标
m_imgList.Create(1616ILC_COLOR32 0 20);

m_ftList.CreatePointFont(90_T(“宋体“));

}

CMyPropertySheet::CMyPropertySheet(LPCTSTR pszCaption CWnd* pParentWnd UINT iSelectPage)
:CPropertySheet(pszCaption pParentWnd iSelectPage) m_nSelectedItem(0) m_clrTextBkSele(RGB(0132255))m_clrSeprator(RGB(0132255))
m_clrCaption(RGB(92132255))
{
m_szCaption = new TCHAR[128];

m_imgList.Create(1616ILC_COLOR32 0 20);
m_ftList.CreatePointFont(90_T(“宋体“));

}

CMyPropertySheet::~CMyPropertySheet()
{

delete [] m_szCaption;

}


BEGIN_MESSAGE_MAP(CMyPropertySheet CPropertySheet)
ON_WM_PAINT()
ON_NOTIFY(NM_CLICK 0xFFFF OnNMClick)
ON_NOTIFY(NM_CUSTOMDRAW0xFFFF OnNMCustomDraw)

END_MESSAGE_MAP()


// CMyPropertySheet 消息处理程序

BOOL CMyPropertySheet::OnInitDialog()
{

BOOL bResult = CPropertySheet::OnInitDialog();
 
//计算属性页的矩形,扩大属性表并将属性页其移至右侧
CRect rect rectPage rectTab;
GetPage(0)->GetWindowRect(&rectPage);

GetWindowRect(&rect);
rect.right += 150;

    int nWidth = rectPage.Width();
rectPage.right = rect.right - 20; 
rectPage.left = rect.right - nWidth;
ScreenToClient(&rectPage);
m_rectPage = rectPage;
MoveWindow(&rect);
GetPage(0)->MoveWindow(&rectPage);
    
//隐藏属性页原来的TabControl
CTabCtrl *pTab = GetTabControl() ;
pTab->GetWindowRect(&rectTab);
ScreenToClient(&rectTab);
if(!pTab->ShowWindow(SW_HIDE))
return FALSE;



   
//创建列表控件并用一个CImageList对象与之关联
if(!m_wndList.Create(WS_CHILD | WS_VISIBLE |  LVS_REPORT | LVS_NOCOLUMNHEADER  CRect(10 rectTab.top150rectPage.bottom )this0xFFFF))
return FALSE;
m_wndList.SetExtendedstyle(LVS_EX_FULLROWSELECT);
m_wndList.SetImageList(&m_imgList LVSIL_SMALL);

InitList();

//这一步是为了扩大行高度
CFont font;
font.CreatePointFont(240_T(“宋体“));
m_wndList.SetFont(&font);

CString strCaption;
GetPage(0)->GetWindowText(strCaption);
_tcscpy(m_szCaption strCaption.GetBuffer(strCaption.GetLength()));

return bResult;
}

void CMyPropertySheet::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rectListrectPage;
m_wndList.GetWindowRect(&rectList);
GetPage(0)->GetWindowRect(&rectPage);
ScreenToClient(&rectPage);
ScreenToClient(&rectList);

rectList.left = rectList.left -1;
rectList.right = rectList.right + 1;
rectList.top = rectList.top - 1;
rectList.bottom = rectList.bottom + 1;

rectPage.left -= 1;
rectPag

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     目录          0  2008-01-12 19:59  代码

     目录          0  2007-12-12 15:47  代码\CMyPropertySheet

     文件      11416  2007-12-14 19:39  代码\CMyPropertySheet\MyPropertySheet.cpp

     文件       1490  2007-12-14 19:26  代码\CMyPropertySheet\MyPropertySheet.h

     目录          0  2008-01-12 20:19  代码\MyPropertySheetDemo

     目录          0  2007-12-14 20:35  代码\MyPropertySheetDemo\MyPropertySheetDemo

     文件       1296  2007-12-14 17:21  代码\MyPropertySheetDemo\MyPropertySheetDemo\ChildView.cpp

     文件        537  2007-12-12 16:32  代码\MyPropertySheetDemo\MyPropertySheetDemo\ChildView.h

     文件       1741  2007-12-12 15:48  代码\MyPropertySheetDemo\MyPropertySheetDemo\MainFrm.cpp

     文件        743  2007-12-12 15:48  代码\MyPropertySheetDemo\MyPropertySheetDemo\MainFrm.h

     文件      11416  2007-12-14 19:39  代码\MyPropertySheetDemo\MyPropertySheetDemo\MyPropertySheet.cpp

     文件       1490  2007-12-14 19:26  代码\MyPropertySheetDemo\MyPropertySheetDemo\MyPropertySheet.h

     文件      44844  2007-12-14 19:23  代码\MyPropertySheetDemo\MyPropertySheetDemo\MyPropertySheetDemo.aps

     文件       2670  2007-12-12 15:48  代码\MyPropertySheetDemo\MyPropertySheetDemo\MyPropertySheetDemo.cpp

     文件        568  2007-12-12 15:48  代码\MyPropertySheetDemo\MyPropertySheetDemo\MyPropertySheetDemo.h

     文件      10909  2007-12-14 19:23  代码\MyPropertySheetDemo\MyPropertySheetDemo\MyPropertySheetDemo.rc

     文件       6217  2007-12-14 17:21  代码\MyPropertySheetDemo\MyPropertySheetDemo\MyPropertySheetDemo.vcproj

     文件       1427  2007-12-14 20:35  代码\MyPropertySheetDemo\MyPropertySheetDemo\MyPropertySheetDemo.vcproj.CHINA-2CB7AA9C4.Administrator.user

     文件       2796  2007-12-12 15:48  代码\MyPropertySheetDemo\MyPropertySheetDemo\ReadMe.txt

     目录          0  2007-12-14 17:54  代码\MyPropertySheetDemo\MyPropertySheetDemo\res

     文件       1150  2007-12-14 17:20  代码\MyPropertySheetDemo\MyPropertySheetDemo\res\Addition.ico

     文件       1150  2007-12-14 17:20  代码\MyPropertySheetDemo\MyPropertySheetDemo\res\Global.ico

     文件       1150  2007-12-14 17:16  代码\MyPropertySheetDemo\MyPropertySheetDemo\res\MyPropertySheetDemo.ico

     文件        375  2007-12-12 15:48  代码\MyPropertySheetDemo\MyPropertySheetDemo\res\MyPropertySheetDemo.rc2

     文件       1607  2007-12-14 17:20  代码\MyPropertySheetDemo\MyPropertySheetDemo\resource.h

     文件        494  2007-12-12 15:52  代码\MyPropertySheetDemo\MyPropertySheetDemo\ServerPge.cpp

     文件        331  2007-12-12 15:52  代码\MyPropertySheetDemo\MyPropertySheetDemo\ServerPge.h

     文件        150  2007-12-12 15:48  代码\MyPropertySheetDemo\MyPropertySheetDemo\stdafx.cpp

     文件       2466  2007-12-12 15:52  代码\MyPropertySheetDemo\MyPropertySheetDemo\stdafx.h

     文件        470  2007-12-12 16:32  代码\MyPropertySheetDemo\MyPropertySheetDemo\UserPge.cpp

............此处省略6个文件信息

评论

共有 条评论