在VC中如何让分割窗口固定其大小??

laughsky 2001-09-05 05:42:29
...全文
233 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
scklotz 2001-09-13
  • 打赏
  • 举报
回复
多谢。。
MSVCer 2001-09-07
  • 打赏
  • 举报
回复
to scklotz(晓春):
下面文档摘自“问专家”资料
SUMMARY
=======
In addition to providing the ability to dynamically split a single view, the CSplitterWnd class provides a convenient method of displaying two or more view classes in a single frame. This type of splitter window is called a "static splitter." The CSplitterWnd class contains member functions that allow the splitter bar to be dragged by the mouse or moved using the keyboard to change the proportionate sizes of the views (or panes, in splitter terminology) within the frame.
Sometimes it is desirable to fix the initial position of the splitter bars and not allow the user to move them. This can be accomplished simply by deriving a class from CSplitterWnd and overriding several members. This method is outlined below.

MORE INFORMATION
================
1. Use ClassWizard to create a new class named CMySplitterWnd of class type "generic CWnd" and change the references to CWnd in the class declaration and BEGIN_MESSAGE_MAP macro to CSplitterWnd.
2. Using ClassWizard, create message handlers for WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, and WM_MOUSEMOVE. Bypass the CSplitterWnd functionality in each of these overrides by calling the corresponding CWnd handlers. The following example illustrates the WM_LBUTTONDOWN handler:

void CMySplitterWnd::OnLButtonDown(UINT nFlags, Cpoint point)
{
CWnd::OnLButtonDown(nFlags, point);
}

3. Change any embedded CSplitterWnd members of your frame class to type CMySplitterWnd.
4. Remove any menu items that generate a ID_WINDOW_SPLIT command (such as the "Split" item on the VIEWEX sample's "Window" menu). This prevents CView::OnSplitCmd() from being called.



此问题由李海回答
scklotz 2001-09-07
  • 打赏
  • 举报
回复
让大家分享一下哦。
laughsky 2001-09-07
  • 打赏
  • 举报
回复
版主,请删了该贴,知道答案了

16,548

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • AIGC Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧