xqyz8888:如何去掉FORM视图FORMVIEW的难看的边框?
1.加入ModifyStyleEx(0, WS_EX_STATICEDGE);
ModifyStyleEx(WS_EX_CLIENTEDGE,0 );
注意,一定要放到CFormView::OnInitialUpdate();之前啊,否则没效果,呵呵!
void CWinStyleTestView::OnInitialUpdate()
{
ModifyStyleEx(0, WS_EX_STATICEDGE);
ModifyStyleEx(WS_EX_CLIENTEDGE,0 );
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
}
2.在OnDraw中绘制边框
void CWinStyleTestView::OnDraw(CDC* pDC)
{
// TODO: Add your specialized code here and/or call the base class
//绘制边框线
CRect rcClient;
GetClientRect(&rcClient); pDC->Draw3dRect(0,0,rcClient.Width(),rcClient.Height(),::GetSysColor(COLOR_BTNSHADOW),::GetSysColor(COLOR_BTNHILIGHT));
}
(发表于2004-3-11 15:29:00)
salam11:这个FormView的父窗口中:
.h中
CxxFormView *xx;
.cpp中
xx=new CxxFormView;
CWnd* pWnd;
pWnd=xx;
pWnd->EnableScrollBarCtrl(0,FALSE);
pWnd->EnableScrollBarCtrl(1,FALSE);
对话框的属性: Style: Child ; Border: Dialog Frame
响应CxxFormView的OnSize
void CxxView::OnSize(UINT nType, int cx, int cy)
{
// CFormView::OnSize(nType, cx, cy);
}
(发表于2004-11-19 9:53:00)
..........................................................................
--------------------next---------------------