1、灰色背景?你可以修改背景色呀。下面就是方法:
To change the background color for a CView, CFrameWnd, or CWnd object, process the WM_ERASEBKGND message. The following code shows how: BOOL CSampleView::OnEraseBkgnd(CDC* pDC)
{
// Set brush to desired background color
CBrush backBrush(RGB(255, 128, 128));
// Save old brush
CBrush* pOldBrush = pDC->SelectObject(&backBrush);
CRect rect;
pDC->GetClipBox(&rect);
// Erase the area needed
pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY);
pDC->SelectObject(pOldBrush);
return TRUE;
}
2、关于View的大小问题,因为View是在主框架窗口中的,所以你调整窗口的大小不就可以了吗?看看下面的英文吧,正好提高一下你的英语水平:)
Normally, you can change the size of a window by calling MoveWindow(). In an application developed with the Microsoft Foundation Class (MFC) Library, the view window is a child window of the frame window that surrounds the view. To change the size of the view window, retrieve a pointer to the frame window of the view by calling GetParentFrame(), then call MoveWindow() to change the size of the parent. When the parent frame window changes size, it automatically changes the size of the view window to fit in the parent frame.
To change the background color for a CView, CFrameWnd, or CWnd object, process the WM_ERASEBKGND message. The following code shows how: BOOL CSampleView::OnEraseBkgnd(CDC* pDC)
{
// Set brush to desired background color
CBrush backBrush(RGB(255, 128, 128));
// Save old brush
CBrush* pOldBrush = pDC->SelectObject(&backBrush);
CRect rect;
pDC->GetClipBox(&rect);
// Erase the area needed
pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY);
pDC->SelectObject(pOldBrush);
return TRUE;
}
2、关于View的大小问题,因为View是在主框架窗口中的,所以你调整窗口的大小不就可以了吗?看看下面的英文吧,正好提高一下你的英语水平:)
Normally, you can change the size of a window by calling MoveWindow(). In an application developed with the Microsoft Foundation Class (MFC) Library, the view window is a child window of the frame window that surrounds the view. To change the size of the view window, retrieve a pointer to the frame window of the view by calling GetParentFrame(), then call MoveWindow() to change the size of the parent. When the parent frame window changes size, it automatically changes the size of the view window to fit in the parent frame.
解决方案 »
- 求Visual Assist X教程,使用方法
- VC6.0中的报表控件的问题??????????
- 高分请教:SPI实现地址重定向后,访问速度过慢
- 单文档中实现间隔0.3秒显示一个新图像覆盖旧的图像
- 经典问题、常见问题解答收集,整理CHM版
- 关于文件COPY的问题
- 梦寐以求的 ★ 终于到手了,为什么我一点也不兴奋。散分顺道问个问题。
- 看过《Windows程序设计》或《MFC windows程序设计》的朋友请进!
- 图片存入数据库的问题
- what to do next?
- vc如何用ado访问mssql(读、写、删),请帮我推荐我几个例子,或文章,谢谢(立即加分)
- visual stuido 6.0中运行2001版的《windows核心编程》例子程序怎么老是提示没有最新的platform SDK
我再试试背景.