Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CButton Objects

Status
Not open for further replies.

trent101

Programmer
Nov 4, 2005
50
AU
Im programming using visual c++, and have started a MFC project. I want to be able to run through a for loop and initialise how many buttons the users wants displayed (CButtons). For an example my code at the moment asks the users how many buttons they want, if the user wants 5 buttons it then runs the line of code:

CButton myButton;

5 times. From what I can see this works ok, but is there a better way of doing this? Should I be using a linked list? Also, because each object I create of type CButton is called myButton, how to I 'talk' to each button when I want to chnage something, if every button I created has the same 'myButton' name? like say the text on the button.

If anyone could help me it would be greatly appreciated.

cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top