请各位老大帮忙。
我在dialog上建立了一个SpliterWnd窗口,SpliterWnd中分为左右两个view,两个View都用Formview来实现,但是总有一个分隔条可以RESIZE,如何禁止?
另外,两个Formview显示在SPliterWnd中都是凹的,如何定制其风格。
谢谢!

解决方案 »

  1.   

    http://www.codeguru.com/splitter/restrict_size.shtml
    http://www.codeproject.com/splitter/flatsplitter.asp
      

  2.   

    你可以重写一个CSplitterWnd类,这样就可以避免WM_SIZE。如果你要的话,我可以给你这样的类。[email protected]
      

  3.   

    定制风格有两个部分:1。在对话框编辑器中,打开窗体的属性,在里面设置风格。2。在CSplitterWnd的CreateView调用中设置风格,不要使用默认风格值。
    不过你说的这个问题是没法解决的,因为FORM并没有真的凹下去,看起来凹是由于CSplitterWnd边界造成的。除非你可以去掉这个边界。
    至于WM_SIZE,如果你禁止了FORM的WM_SIZE消息,则CSplitterWnd也就不能改变大小了。如果你重载了CSplitterWnd的鼠标拖动消息处理函数,并且不做什么操作,也可以达到相同的效果。建议从CSplitterWnd派生一个类,重载相应消息处理函数。
      

  4.   

    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)
      

  5.   

    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)
      

  6.   

    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)