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!

Loop through controls on a dialog

Status
Not open for further replies.

Wings

Programmer
Feb 14, 2002
247
US
Hello,
Can any one tell me or point me in the right direction on how to programatically loop through the different controls on a form to set various attributes in each one. I am using MFC in visual studio.net.

Thank you
 
you can add them into an array of CWnd's because basically all controls are windows ... and then loop through the array and change the properties ....
 
If you mean just the controls who have the WS_TABSTOP style (trhe ones that you can get by preassing tab), you can use the GetNextDlgTabItem CWnd member function.

Other method for all the child windows on a CWnd.
Get a pointer to the fisrt child window the call CWnd::GetNextWindow.

s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top