我要作一个单文档程序,文件一打开直接显示出一个界面,很像对话框,或者说就是一个对话框,不过是没有标题栏这些东西,任何时候都显示。想问的是,是不是控件只能放在对话框上面,在文档的编辑区没法放置?我要做到上面的要求,是不是只能作一个对话框,去掉标题部分,程序一运行就打开这个对话框?

解决方案 »

  1.   

    你自己做一个浮动的toolbar,把该toolbar的系统menu取消,然后禁止它停靠,这样做不是更好?
    我不知道理解对你的意思没有
    具体例子可以看vckbase里面的例子
      

  2.   

    可以在view上放
    CButton *p;
    p = new CButton;
    p->Create(...);
    可以在指定的地方创建控件MSDN里的内容和例子CButton::Create 
    BOOL Create( LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );Return ValueNonzero if successful; otherwise 0.ParameterslpszCaptionSpecifies the button control’s text.dwStyleSpecifies the button control’s style. Apply any combination of button styles to the button.rectSpecifies the button control’s size and position. It can be either a CRect object or a RECT structure.pParentWndSpecifies the button control’s parent window, usually a CDialog. It must not be NULL.nIDSpecifies the button control’s ID.ResYou construct a CButton object in two steps. First call the constructor, then call Create, which creates the Windows button control and attaches it to the CButton object.If the WS_VISIBLE style is given, Windows sends the button control all the messages required to activate and show the button.Apply the following window styles to a button control: WS_CHILD   Always
    WS_VISIBLE   Usually
    WS_DISABLED   Rarely
    WS_GROUP   To group controls
    WS_TABSTOP   To include the button in the tabbing order 
    ExampleCButton myButton1, myButton2, myButton3, myButton4;// Create a push button.
    myButton1.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 
       CRect(10,10,100,30), pParentWnd, 1);// Create a radio button.
    myButton2.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_RADIOBUTTON, 
       CRect(10,40,100,70), pParentWnd, 2);// Create an auto 3-state button.
    myButton3.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_AUTO3STATE, 
       CRect(10,70,100,100), pParentWnd, 3);// Create an auto check box.
    myButton4.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_AUTOCHECKBOX, 
       CRect(10,100,100,130), pParentWnd, 4);
      

  3.   

    动态创建是可行的
    也可以从cformview继承
      

  4.   

    不用formview就在cview上也可以添加啊,动态创建
      

  5.   

    动态创建用CWnd->Create
    想放到那儿就放到那儿
      

  6.   

    bobob(静思--潜心研究PDF),lemonvivian(柠檬渴爱)
    具体怎么继承呢?麻烦说的详细些,谢谢!