How you create a button dynamically?
Answers were Sorted based on User's Feedback
1. Create a Object from CButton control. CButton m_ctlButton
2.
m_ctlButton.Create("OK",ES_CHILD|ES_VISIBLE,CRect(0,0,100,100),CWnd*
pParentWnd,MB_OK);
with this we can create the button by dynamically.
| Is This Answer Correct ? | 12 Yes | 3 No |
Answer / 106743013743
CButton 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);
| Is This Answer Correct ? | 1 Yes | 0 No |
What view class enables you to use an edit control as a view?
What is the base class for MFC
Tell me the work of HTREDUCE and HTZOOM
What is the difference between the Encapsulation and Abstraction
25 Answers HCL, Invensys, TCS, Wipro,
Which Macro is a Super set of other two macro DECLARE_SERIAL,DECLARE_DYNAMIC and DECLARE_DYNCREATE. ?
What is the difference between GetMessage and PeekMessage ?
How can i implement the dynamic menus in MFC plz give the code
what is the size of a process
How to create a Modeless Dialog?
What is the difference between ASSERT and VERIFY?
Can you explaing the relashionship between document,frame and view ?
1)To Remove WS_MINIMIZEBOX in a Frame ?