送分问题:(SpliterWnd与Formview如何定制其风格并且不能RESIZE

wuxuan 2002-07-08 08:49:35
请各位老大帮忙。
我在dialog上建立了一个SpliterWnd窗口,SpliterWnd中分为左右两个view,两个View都用Formview来实现,但是总有一个分隔条可以RESIZE,如何禁止?
另外,两个Formview显示在SPliterWnd中都是凹的,如何定制其风格。
谢谢!
...全文
52 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wuxuan 2002-07-09
  • 打赏
  • 举报
回复
谢谢各位
xiesl 2002-07-08
  • 打赏
  • 举报
回复
定制风格有两个部分:1。在对话框编辑器中,打开窗体的属性,在里面设置风格。2。在CSplitterWnd的CreateView调用中设置风格,不要使用默认风格值。
不过你说的这个问题是没法解决的,因为FORM并没有真的凹下去,看起来凹是由于CSplitterWnd边界造成的。除非你可以去掉这个边界。
至于WM_SIZE,如果你禁止了FORM的WM_SIZE消息,则CSplitterWnd也就不能改变大小了。如果你重载了CSplitterWnd的鼠标拖动消息处理函数,并且不做什么操作,也可以达到相同的效果。建议从CSplitterWnd派生一个类,重载相应消息处理函数。
winne_ll 2002-07-08
  • 打赏
  • 举报
回复
你可以重写一个CSplitterWnd类,这样就可以避免WM_SIZE。如果你要的话,我可以给你这样的类。wine_ll@sina.com
wistaria 2002-07-08
  • 打赏
  • 举报
回复
http://www.codeguru.com/splitter/restrict_size.shtml
http://www.codeproject.com/splitter/flatsplitter.asp
蒋晟 2002-07-08
  • 打赏
  • 举报
回复
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.


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);
}
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.

2 remove WS_EX_CLIENTEDGE style(this style is added by MFC by default)
蒋晟 2002-07-08
  • 打赏
  • 举报
回复
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.


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);
}
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.

2 remove WS_EX_CLIENTEDGE style(this style is added by MFC by default)
蒋晟 2002-07-08
  • 打赏
  • 举报
回复
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.


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);
}
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.

2 remove WS_EX_CLIENTEDGE style(this style is added by MFC by default)

16,472

社区成员

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

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

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