hi... could anyone please help me with how to create buttons dynamically in vc++ 6.0 dailog based application

Recommended Answers

All 10 Replies

you are in the wrong section, this is a Visual Basic discussion group

Moving to C++.

sorry, i'll post in c++

Are you writing an MFC or win32 program?

it s on mfc

Here's how (link)

CButton* pButton = new CButton;
pButton->Create( /* add parameters here */ );
commented: Quick, useful, practical, informative posts. +5

can u say me how to do it on a win32 program

can u say me how to do it on a win32 program

Read this tutorial and you will find out how to do it.

in case if i need to place 40 buttons on the dialog during run time what should i do...

make an array of HWND objects and call CreateWindow() 40 times. When one of the buttons is clicked windows will call your WinProc() function with the button's HWND.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.