How to set the border width of dialog box
-
-
I have ceated a dialog box whose bporder width seems to be thick around 2 pixel. How can I increase/decrease the boreder width of dialog box Any kind of help is appreciated. Cheers
"A winner is not one who never fails...but the one who never quits"
You need to increase non client area size for this purpose handle WM_NCCALCSIZE, add a message map entry for ON_WM_NCCALCSIZE()... A sample implementation looks likewise...
void CDialogTestDlg::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp)
{
UNREFERENCED_PARAMETER( bCalcValidRects ); // Read the docs on this variable// Increase border width by 4!
lpncsp->rgrc->top += 4;
lpncsp->rgrc->left += 4;
lpncsp->rgrc->bottom -= 4;
lpncsp->rgrc->right -= 4;
CWnd::OnNcCalcSize( bCalcValidRects, lpncsp );
}Also note that you may need to handle
WM_NCPAINT
to fill out increased region.Nibu babu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com