您可以在这里快速查找:


 
您的位置: 编程学习 > C++/VC > 200510
文章分类

Java技术
2005: 03 04 05 06 07 08
09 10 11 12
2006: 01 02

Asp.net
2005: 07 08 09 10 11 12
2006: 01 02

VB编程
2006: 02

Asp编程
2005: 11 12
2006: 01 02

C++/VC
2005: 10 11 12
2006: 01 02

Delphi
2005: 12
2006: 01 02

其它

 本文章适合所有读者

有关属性对话框(property sheet )的几个提示

ShowMan

有关属性对话框(property sheet )的几个提示

闻怡洋

下面的所有例子,都假定你从CPropertySheet中派生了新类。

1、隐藏APPLY按钮

使用 PSH_NOAPPLYNOW 标志.

propsheet.m_psh.dwFlags |= PSH_NOAPPLYNOW;
2、增加新的子窗口
使用成员变量。CEdit m_edit. BOOL CMyPropSheet::OnInitDialog() { BOOL bResult = CPropertySheet::OnInitDialog(); CRect rectWnd; GetWindowRect(rectWnd); SetWindowPos(NULL, 0, 0, rectWnd.Width() + 100, rectWnd.Height(), SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); m_edit.CreateEx( WS_EX_CLIENTEDGE, _T("EDIT"), NULL, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER, rectWnd.Width(), 20, 80, 24, m_hWnd, 0, 0 ); m_edit.SetFont( GetFont() ); CenterWindow(); return bResult; }
3、改变页片上的字体

在 OnInitDialog() 中:

// m_fontEdit is a member variable // Create a bold font m_fontEdit.CreateFont( -8, 0, 0, 0, 700, 0, 0, 0, 1, 0, 0, 0, 0, _T("MS Sans Serif") ); GetTabControl()->SetFont( &m_fontEdit );

4、使用Image

m_imageTab为成员变量。
BOOL CMyPropSheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();

m_imageTab.Create( IDB_TABIMAGES, 13, 1, RGB(255,255,255) );
CTabCtrl *pTab = GetTabControl();
pTab->SetImageList( &m_imageTab );

TC_ITEM tcItem;
tcItem.mask = TCIF_IMAGE;
for( int i = 0; i < 3; i++ )
{
tcItem.iImage = i;
pTab->SetItem( i, &tcItem );
}
return bResult;
}

 


摘自玉海园 http://www.mfc2000.yeah.net