-
September 19th, 2009, 08:02 AM
#1
Button border remove
i want to remove DialogBox Button's border without OwnerDraw. Im using Win32 not MFC. Please guide how to do it.
-
September 19th, 2009, 09:17 AM
#2
Re: Button border remove
You want to remove the border of the buttons on a dialog box? Or you want to remove the border of a dialog box? I'm a little bit confused here.
Without owner draw, you could try to use the BS_FLAT style, but it might still have a border.
-
September 19th, 2009, 09:58 AM
#3
Re: Button border remove
I need to remove button border in dialogbox.
-
September 20th, 2009, 02:23 AM
#4
-
September 20th, 2009, 08:47 AM
#5
Re: Button border remove
Originally Posted by hypheni
Any one??
You didn't answer on this question:
Originally Posted by cilu
You want to remove the border of the buttons on a dialog box? Or you want to remove the border of a dialog box? I'm a little bit confused here.
So, again:
to remove border of the button in dialogbox
or
to remove border of the dialogbox?
Victor Nijegorodov
-
September 20th, 2009, 12:08 PM
#6
Re: Button border remove
why you guys are so confused.. its clearly written in the title that "Button border remove".. so what does this means... i want to remove button borders within dialog box
-
September 20th, 2009, 12:21 PM
#7
Re: Button border remove
Code:
CWnd::ModifyStyle (WS_BORDER, 0);
-
September 20th, 2009, 01:44 PM
#8
Re: Button border remove
This is a MFC code. How to apply this in Win32 coding..
-
September 20th, 2009, 02:53 PM
#9
Re: Button border remove
You can use GetWindowLong() and SetWindowLong().
Code:
DWORD styles = ::GetWindowLong(hWnd, GWL_STYLE);
styles &= ~WS_BORDER;
::SetWindowLong(hWnd, GWL_STYLE, styles);
I'm not sure this is going to work though. But on the other hand, I never tried it.
-
September 22nd, 2009, 02:11 PM
#10
-
September 22nd, 2009, 03:40 PM
#11
Re: Button border remove
Originally Posted by hypheni
No.. no use
Could you translate it?
Victor Nijegorodov
-
September 23rd, 2009, 02:16 AM
#12
Re: Button border remove
The code posted by Cilu did not serve my purpose. I need to remove Button border within a dialogbox without using owner draw..
-
September 23rd, 2009, 02:48 AM
#13
Re: Button border remove
Use Spy++ to find out this button styles. Then try to remove all styles that could cause any type of the border (use the code similar to what cilu posted)
Victor Nijegorodov
-
September 23rd, 2009, 02:59 AM
#14
Re: Button border remove
Cilu's code has nothing to do with ownerdraw or not. It simply changes a windowstyle. Below you see the MFC implementation. It's allmost the same. And this code has also nothing to do with ownerdraw.
Code:
AFX_STATIC BOOL AFXAPI _AfxModifyStyle(HWND hWnd, int nStyleOffset,
DWORD dwRemove, DWORD dwAdd, UINT nFlags)
{
ASSERT(hWnd != NULL);
DWORD dwStyle = ::GetWindowLong(hWnd, nStyleOffset);
DWORD dwNewStyle = (dwStyle & ~dwRemove) | dwAdd;
if (dwStyle == dwNewStyle)
return FALSE;
::SetWindowLong(hWnd, nStyleOffset, dwNewStyle);
if (nFlags != 0)
{
::SetWindowPos(hWnd, NULL, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | nFlags);
}
return TRUE;
}
-
September 23rd, 2009, 10:54 AM
#15
Re: Button border remove
Just checked in spy++.. there is no style dealing with button border..
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
|