在MFC中如何动态创建静态文本框?

解决方案 »

  1.   

    CSatic.Create(父指针,位置,风格) ;详细,请看MSDN
      

  2.   

    Creates the Windows static control and attaches it to the CStatic object.virtual BOOL Create(
       LPCTSTR lpszText,
       DWORD dwStyle,
       const RECT& rect,
       CWnd* pParentWnd,
       UINT nID = 0xffff 
    );
     
    CStatic myStatic;// Create a child static control that centers its text horizontally.
    myStatic.Create(_T("my static"), WS_CHILD|WS_VISIBLE|SS_CENTER, 
       CRect(10,10,150,50), pParentWnd);
      

  3.   

    myStatic.Create(_T("my static"), WS_CHILD|WS_VISIBLE|SS_CENTER, 
       CRect(10,10,150,50), pParentWnd);
      

  4.   

    谢谢各位!我把分分给myfriend023()和wsb_8224() !