Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Istvan Horgos
|
Aug 1, 2005 - 8:57 PM
|
Hallo, how to modify thin border in CExtPropertyGridCtrl in order to inflate its rect for 1 pixel in all 4 directions? I allready have my own class derived. Thanks!
|
|
Technical Support
|
Aug 2, 2005 - 7:05 AM
|
This thin border is painted by the CExtPaintManager::PaintResizableBarChildNcAreaRect() virtual method. Each CExtPropertyGridWnd tree grid window inside the CExtPropertyGridCtrl container handles the WM_NCCALCSIZE and WM_NCPAINT standard windows messages for implementing a thin border. Here is the source code of these methods: void CExtPropertyGridWnd::OnNcCalcSize(
BOOL bCalcValidRects,
NCCALCSIZE_PARAMS FAR * lpncsp
)
{
ASSERT_VALID( this );
bCalcValidRects;
lpncsp->rgrc[0].left++;
lpncsp->rgrc[0].top++;
lpncsp->rgrc[0].right--;
lpncsp->rgrc[0].bottom--;
}
void CExtPropertyGridWnd::OnNcPaint()
{
ASSERT_VALID( this );
CWindowDC dcWindow( this );
CRect rcClient, rcBar;
GetClientRect( rcClient );
ClientToScreen( rcClient );
GetWindowRect( rcBar );
rcClient.OffsetRect( -rcBar.TopLeft() );
rcBar.OffsetRect( -rcBar.TopLeft() );
dcWindow.ExcludeClipRect(rcClient);
CExtMemoryDC dc( &dcWindow, &rcBar );
g_PaintManager->PaintResizableBarChildNcAreaRect( dc, rcBar, this );
} You can also use the CExtWRB template class to add a stylish border to the window.
|
|