Is there a way to set the CFrameWnds edge as NONE?
I want to create a CFrameWnd object and want it to look like a NO border CWnd, Is it possible?
Look forword to your help!
thanks!
Mynfred
[164 byte] By [
mynfred] at [2007-11-18 17:42:23]

# 1 Re: Is there a way to set the CFrameWnds edge as NONE?
You can modify the style bits of the main window by adding
PreCreateWindow(...) to the CMainFrame Class and tweaking
the values in cs.style.
Maybe what you want is
cs.style &= ~WS_THICKFRAME;
# 2 Re: Is there a way to set the CFrameWnds edge as NONE?
It doesn't work! The border still there in my demo!
# 3 Re: Is there a way to set the CFrameWnds edge as NONE?
What Do you define "Border" to be?
# 4 Re: Is there a way to set the CFrameWnds edge as NONE?
It doesn't work! The border still there in my demo!
_______________________________________________
CFrameWnd::PreCreateWindow(cs);
cs.style &=( ~WS_THICKFRAME);
return TRUE;
# 5 Re: Is there a way to set the CFrameWnds edge as NONE?
Try
cs.style &= ~(WS_THICKFRAME | WS_BORDER);
Darwen.
darwen at 2007-11-11 1:30:07 >

# 6 Re: Is there a way to set the CFrameWnds edge as NONE?
I make a class CFrameWndEx by inherinting CFrameWnd,And In it's PreCreateWindow,
------------------
BOOL CFrameWndEx::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Add your specialized code here and/or call the base class
CFrameWnd::PreCreateWindow(cs);
cs.style &=~(WS_THICKFRAME | WS_BORDER);
return TRUE;
}
------------------
I wrote following code at I need the NO border CFrameWndEx,
---------------------
CString strGrayWndClass =AfxRegisterWndClass (CS_GLOBALCLASS|CS_DBLCLKS, LoadCursor(NULL,IDC_ARROW), 0);
m_pFrameWnd = new CFrameWndEx;
CRect rcClient;
GetClientRect(rcClient);
m_pFrameWnd->Create(strGrayWndClass,NULL,WS_CHILD|WS_VISIBLE,rcClient,this,NULL);
---------------
But the border still exist, Is there something wrong?
Look forward to your help!
Thank you!
# 7 Re: Is there a way to set the CFrameWnds edge as NONE?
Originally quoted by SoulDog
What Do you define "Border" to be?
Yeah what do you mean by "border"?
Do you just want a white square with no menu,no title bar,no status bar, no... nothing but a white square?
If that is what you want then don't use a CFrameWnd for the main window.
TDM
TDM at 2007-11-11 1:32:07 >

# 8 Re: Is there a way to set the CFrameWnds edge as NONE?
Yes, I want the window you say, but the reason I use CFrameWnd is I want put a CFormView or a CSrollView on it. I think CFrameWnd is a good choice excpect I cann't remove the border or frame of the CFrameWnd.