Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I want to Create Controls(edit, static, combobox, datepicker, radiobutton) in VC++ 6.0 MFC at runtime and dynamically create message maps.
In VB6 i can do it by creating a control array.

Anyone who knows the code?
thaks in advance. :)
Posted

You can do it by calling appropriate Create functions of classes.. For example yu can create Edit box by calling CEdit::Create function.

if you need to add events , sub class it and add the desired handlers using message maps. It is pretty easy.

Hopes this helps
http://cgmath.blogspot.com
 
Share this answer
 
I have an app article here on codeproject:
BasicAdmin2 - Personal Finance Software[^]

In the file BasicAdmin2_Utils/GenDialog/DialogHelper.cpp you'll find:

CreateLabel
CreateGroupBox
CreateComboBox
CreateTextBox
CreateShortCutBox
CreateNumeric
CreateDate
CreateDateTime
CreateMultiEdit
CreateCheckBox

All of them use Create and CreateEx.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900