应该在哪里加什么代码还有就是怎么可以让formview不显示上下左右滚动条

解决方案 »

  1.   

    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)    
    {..
             cs.style&=WS_POPUPWINDOW;
    cs.cx=600;
    cs.cy=300;  
    return TRUE;  
    }
      

  2.   

    Q:如何改变一个CFormView的大小?在类ClikethisView中声明如下函数:
      virtual void OnInitialUpdate();在ClikethisView的代码中,函数如下:  void ClikethisView::OnInitialUpdate()
      {
          //使窗口与主对话框同样大小
          CFormView::OnInitialUpdate();
          GetParentFrame()->RecalcLayout();
          ResizeParentToFit( /*FALSE*/ );//must be false;
      }
    Q:如何改变一个视图的大小? 
    A:通常,你可以调用函数MoveWindow()或者SetWindowPos()来改变窗口的大小。在用MFC库开发的应用程序中, 视图是被框架窗口所围绕的一个子窗口。为了改变一个视图的大小,你可以通过调用函数GetParentFrame()来得到框架窗口的指针,然后调用函数MoveWindow()/SetWindowPos()来改变父窗口的大小。当父框架窗口改变大小时,视图也会自动地改变大小来适应父窗口。 或者
    向下面那样不能改变窗口的大小      BOOL CChildFrame::PreCreateWindow(CREATESTRUCT &cs)
          {
             cs.style &= ~WS_THICKFRAME;
             return CFrameWnd::PreCreateWindow(cs);
          } 或者:
    Q: How do I restrict my window so it can't be resized larger or smaller than a certain size? (top)A:You restrict your window's size by handling the WM_GETMINMAXINFO message. Your handler receives a pointer to a MINMAXINFO struct, which you fill in with the minimum and/or maximum size for your window. Here is an example that keeps the window between 100x150 and 600x400 pixels in size.LRESULT OnGetMinMaxInfo ( WPARAM wParam, LPARAM lParam )
    {
    MINMAXINFO* pmmi = (MINMAXINFO*) lParam;
     
      pmmi->ptMinTrackSize.x = 100;
      pmmi->ptMinTrackSize.y = 150;
      pmmi->ptMaxTrackSize.x = 600;
      pmmi->ptMaxTrackSize.y = 400;
     
      return 0;
    }
    In MFC, your OnGetMinMaxInfo() handler is passed a MINMAXINFO* directly, but otherwise the code is the same.
      

  3.   

    to:psusong(爱因思念-闭关修炼中...) 
    你的faq在哪里可以找得到呀?
    还有其他的吗?
      

  4.   

    to qinghero(水阔长江) 我自己整理的!
    以前整理了有将近1000条!但是很不幸,由于系统的崩溃,现在只剩下有限的100多条了近期准备重新整理
    也为了整理一下自己学过的琐碎的东西
      

  5.   

    psusong(爱因思念-闭关修炼中...) 敬佩!!!向你学习!!我现在也学着整理。什么时候写成个原创文档,发布出来 ? 我给你捐赠我的可用分!!