Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
var
i, j: Integer;
groupBox: TGroupBox;
checkBox: TCheckBox;
begin
for i := 0 to PageControl1.Pages[0].ControlCount - 1 do
begin
if PageControl1.Pages[0].Controls[i] is TGroupBox then
begin
groupBox := (PageControl1.Pages[0].Controls[i] as TGroupBox);
for j := 0 to groupBox.ControlCount - 1 do
begin
if groupBox.Controls[j] is TCheckBox {or whatever} then
begin
checkBox := (groupBox.Controls[j] as TCheckBox);
if checkBox.Checked then
ShowMessage(checkBox.Name + ' is checked')
else
ShowMessage(checkBox.Name + ' is unchecked');
end;
end;
end;
end;
end;
dim ctrl as control
for each ctrl in groupbox.controls
msgbox ctrl.value
next ctrl
for j := 0 to groupBox.ControlCount - 1 do
begin
stream.Write(groupbox.Controls[j].Value)
end;
var
i, j: Integer;
groupBox: TGroupBox;
checkBox: TCheckBox;
radioButton: TRadioButton;
begin
for i := 0 to PageControl1.Pages[0].ControlCount - 1 do
begin
if PageControl1.Pages[0].Controls[i] is TGroupBox then
begin
groupBox := (PageControl1.Pages[0].Controls[i] as TGroupBox);
for j := 0 to groupBox.ControlCount - 1 do
begin
// check if control is a TCheckBox
if groupBox.Controls[j] is TCheckBox then
begin
checkBox := (groupBox.Controls[j] as TCheckBox);
if checkBox.Checked then
ShowMessage(checkBox.Name + ' is checked')
else
ShowMessage(checkBox.Name + ' is unchecked');
end;
// check if control is a TEdit
if groupBox.Controls[j] is TEdit then
ShowMessage((groupBox.Controls[j] as TEdit).Text);
// check if control is a TRadioButton
if groupBox.Controls[j] is TRadioButton then
begin
radioButton := (groupBox.Controls[j] as TRadioButton);
if radioButton.Checked then
ShowMessage(radioButton.Name + ' is checked')
else
ShowMessage(radioButton.Name + ' is unchecked');
end;
end;
end;
end;
end;
Contains a text string associated with the control.
property Text: TCaption;
Description
Use the Text property to read the Text of the control or specify a new string for the Text value. By default, Text is the control name. For edit controls and memos, the Text appears within the control. For combo boxes, the Text is the content of the edit control portion of the combo box.
Note: Controls that display text use either the Caption property or the Text property to specify the text value. Which property is used depends on the type of control. In general, Caption is used for text that appears as a window title or label, while Text is used for text that appears as the content of a control.
groupBox.Controls[j].Text;
var
i, j: Integer;
groupBox: TGroupBox;
begin
for i := 0 to PageControl1.Pages[0].ControlCount - 1 do
begin
if PageControl1.Pages[0].Controls[i] is TGroupBox then
begin
groupBox := (PageControl1.Pages[0].Controls[i] as TGroupBox);
for j := 0 to groupBox.ControlCount - 1 do
begin
ShowMessage(groupBox.Controls[j].Name + ': ' + groupBox.Controls[j].Hint);
end;
end;
end;
end;
var
Buffer : PChar;
Size : Byte;
strValue : string[255];
begin
for j := 0 to groupBox.ControlCount - 1 do
begin
size := groupBox.Controls[j].gettextlen;
inc(size);
getmem(buffer,size);
groupBox.Controls[j].GetTextBuf(buffer,size);
strvalue := strPas(buffer);
freemem(buffer,size);
showmessage(strvalue);
end;