|
-
March 22nd, 2004, 03:16 PM
#1
SetWindowRgn for a button
Is it true that SetWindowRgn is not applicapable for buttons and also another controls of window?
It's just because I cannot set a region for the button on my dialog window in OnInitDialog, This is the code:
Code:
CWnd *pBtn = GetDlgItem( IDC_BUTTON1 );
CRect rc;
pBtn->GetWindowRect( &rc );
HRGN hRgn = CreateEllipticRgn( 0, 0, rc.Width(), rc.Height() );
pBtn->SetWindowRgn( hRgn, TRUE );
For the top level window (that is for dialog window) this code works well, but for a button - nothing changes.
-
May 3rd, 2004, 12:58 PM
#2
ModifyStyle(0, WS_CLIPCHILDREN | WS_CLIPSIBLINGS , SWP_FRAMECHANGED);
But do not expect the end of your trouble. Button drawing is complex; it draws itself with three colors, not to mention default button frame.
There are only 10 types of people in the world:
Those who understand binary and those who do not.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|