Solved

Dynamic Controls

Posted on 2000-04-20
2
152 Views
Last Modified: 2013-11-20
Hi,

I have an application, in my i want create the control dynamically (button and edit) how to create the same?  if send me a piece of code that will  help me continue with my application.


bye
Arora
0
Comment
Question by:Arora
2 Comments
 
LVL 8

Accepted Solution

by:
VinExpert earned 50 total points
ID: 2737044
Hi,

Do like this.
Have the CButton or CEdit pointers in the .h file for that class as
CEdit *m_edit;
CButton *m_button;

In the constructor do
m_edit = NULL;
m_button = NULL;

When creating
m_edit->Create(WS_VISIBLE | ES_LEFT | WS_CHILD, CRect(10,10,100,100), this, 4545);
m_edit->ShowWindow(SW_SHOW);

m_button->Create("Hi", WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON, CRect(110,110, 150, 150), this, 5555);
m_button->ShowWindow(SW_SHOW);

Here I have given some co-ords and id. U can specify them.

Hope this helps.
VinExpert
0
 

Author Comment

by:Arora
ID: 2741778

Thank you, but it will not work untill  you make the following change
 in constructor
m_edit =(CEdit*) new CEdit;
   m_button =(CButton*) new CButton;


bye
arora
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Show shut-down message as Windows 8 shuts down. 9 107
Turn a spreadsheet into a vba executable. 2 98
viewing source code from eclipse 13 110
Fibonacci challenge 11 138
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question