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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looping through controls of a dialog

Status
Not open for further replies.

ionutdinulescu

Programmer
Jun 11, 2002
59
GB
Hello !
I have a dialog with a lot of controls on it. When it is resized, i want all of its controls to be moved relative to the border.
Do you know a way to loop through all these controls ? I would like to have a for/while loop as a solution.

Thank you .
 
Somewhere the dialog:

Code:
  CWnd* ctrl = GetWindow(GW_CHILD);
  while (ctrl != NULL)
  {
    // Move the ctrl or whatever
    // ...

    ctrl = ctrl->GetNextWindow();
  }

/Per

"It was a work of art, flawless, sublime. A triumph equaled only by its monumental failure."
 
I would use GetNextDlgTabItem(), or what I did was use the EasySize article found here: This is just a header file you add to your project, #include into your dialog's header file, then you can set up resize parameters for all of your dialog's controls. It's very easy and quite effective.

BlackDice

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top