可以在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);
我不知道理解对你的意思没有
具体例子可以看vckbase里面的例子
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);
也可以从cformview继承
想放到那儿就放到那儿
具体怎么继承呢?麻烦说的详细些,谢谢!