xingstar
June 3rd, 1999, 08:11 PM
I have a database project to finish. I have to dynamically create some edit box controls on a dialog box and the number of edit box controls
depends on my input. Please help me! Thanks a lot!
suganyas
June 4th, 1999, 12:19 AM
Hi!
U need to make use of the CreateWindow function to create the edit box dynamically.The prototype is :
HWND CreateWindow( LPCTSTR lpClassName, // pointer to registered class name
LPCTSTR lpWindowName, // pointer to window name
DWORD dwStyle, // window style
int x, // horizontal position of window
int y, // vertical position of window
int nWidth, // window width int nHeight, // window height
HWND hWndParent, // handle to parent or owner window
HMENU hMenu, // handle to menu or child-window identifier
HANDLE hInstance, // handle to application instance
LPVOID lpParam // pointer to window-creation data);
Sample code for creating edit control dynamically :
HWND hWnd;
hWnd = ::CreateWindow("Edit","SampleEdit",ES_MULTILINE|WS_CHILD|WS_VISIBLE,20,40,100,30,this->m_hWnd,NULL,AfxGetApp()->m_hInstance,NULL);
Regards,
Sukanya Swaminathan
Software Engineer
Aditi Technologies
Blore - 80
URL : www.aditi.com
xingstar
June 4th, 1999, 11:21 AM
Hi, Sukanya Swaminathan,
Thanks a lot for your help! It really works. So I can use the same method to dynamically create any control, right?