I was able to locate a sample on the web. Mostly it's a matter of how
to phrase the question.
This code works when passed a TTabsheet.
You are correct in that once a groupbox is found on a TTabsheet, you must iterate
through the groupbox controls and then determine what you want to do
for each type of Control.
Thanks for your response.
procedure ResetControls(aPage:TTabSheet);
var
s : string;
j : integer;
loop : integer;
groupBox: TGroupBox;
begin
if assigned(aPage) then
begin
for loop := 0 to aPage.controlcount-1 do
begin
s := aPage.Controls[loop].Name;
//display controls on tab sheet
MessageDlg ('TabSheet Control Name: ' + s , mtConfirmation, [mbOK], 0);
//check if control is a TGroupbox
if aPage.Controls[loop] is TGroupBox then
begin
//if TGroupbox, set local groupBox assignmnet
groupBox := (aPage.Controls[loop] as TGroupBox);
//count the number of controls in the groupbox
for j := 0 to groupBox.ControlCount - 1 do
begin
// check if control is a TEdit
if groupBox.Controls[j] is TEdit then
ShowMessage((groupBox.Controls[j] as TEdit).Text);
end;
end;
if aPage.Controls[loop].ClassType = TCheckBox then
TCheckBox(aPage.Controls[loop]).Checked := false
else if aPage.Controls[loop].ClassType = TComboBox then
TComboBox(aPage.Controls[loop]).itemindex := -1;
end;
end;
end;