Hello,
I need to create multiple controls drop box, edit box , checkbox etc in a dialog dynamically at runtime on button click.
The case is that, if user clicks on add button a set of controls should get added in a row into form. if user again clicks add button, again set of controls should get added in new row.
Can anybody suggest any way to achieve this in MFC.
It would look like as below.
|----------------------------------------------------------------| //Form start
Label1 ComboBox1 EditText1 Combobox2 Submit Button
Label2 ComboBox2 EditText2 Combobox3 Submit Button
Label3 ComboBox4 EditText3 Combobox6 Submit Button
|-----------------------------------------------------------------| form end
I know how to create a control dynamically in MFC but for above case I am not sure on approach which will do the job.
Any suggestion will be very much appreciated.
Regards,
Joy
What I have tried:
What I was planning is to write a method in which there will be code to create controls dynamically and I guess I need to track the position of new controls so that controls can be arranged in row dynamically.
This is just a thought have not tried yet. Looking forward to hear from some expert.