void ChooseServerForm::PositionColumns() { ListControl *plstc = (ListControl *)GetControlPtr(kidcServerList); Rect rcList; plstc->GetRect(&rcList); Font *pfnt = plstc->GetFont(); LabelControl *plblPlayers = (LabelControl *)GetControlPtr(kidcNumPlayers); int cxNumPlayers = pfnt->GetTextExtent(plblPlayers->GetText()); int xNumPlayers = rcList.right - cxNumPlayers; LabelControl *plblStatus = (LabelControl *)GetControlPtr(kidcServerStatus); int cxStatus = pfnt->GetTextExtent(plblStatus->GetText()); int xStatus = xNumPlayers - 40 - cxStatus; int xLocation = rcList.left + (xStatus - rcList.left) / 2; int xName = rcList.left; plstc->SetTabStops(xName - rcList.left, xLocation - rcList.left, xStatus + cxStatus / 2 - rcList.left, xNumPlayers + cxNumPlayers / 2 - rcList.left); plstc->SetTabFlags(0, 0, kfLstTabCenterOn, kfLstTabCenterOn); word ids[] = { kidcServerName, kidcServerLocation, kidcServerStatus, kidcNumPlayers }; int ax[] = { xName, xLocation, xStatus, xNumPlayers }; for (int i = 0; i < ARRAYSIZE(ids); i++) { LabelControl *plbl = (LabelControl *)GetControlPtr(ids[i]); Rect rcCtl; plbl->GetRect(&rcCtl); plbl->SetPosition(ax[i], rcCtl.top); } }