var i: Integer; begin for i := 0 to self.ControlCount - 1 do if self.Controls[i] is TCheckBox then if TCheckBox(self.Controls[i]).Checked then 有被选中的... end;
var i: Integer; begin for i := 0 to panel1.ControlCount - 1 do if panel1.Controls[i] is TCheckBox then if TCheckBox(panel1.Controls[i]).Checked then 有被选中的... end;
procedure TForm1.Button3Click(Sender: TObject); var i,a:integer; begin for i:=0 to Form1.ComponentCount-1 do begin if Form1.Components[i] is TEdit then Form1.Components[i].Visible:=false;///////这个不能通过 end; end;Components与controls什么区别啊 ?
Form的事件内var i: Integer; begin for i := 0 to ComponentCount - 1 do if ((Components[i] is TCheckBox) and (Components[i] as TCheckBox).Checked) then 有被选中的... end;
在帮助的索引中输入:TComponent,Components看看解释:Lists all components owned by the component.property Components[Index: Integer]: TComponent;DescriptionUse Components to access any of the components owned by this component, such as the components owned by a form. The Components property is most useful when referring to owned components by number rather than name. It is also used internally for iterative processing of all owned components.Note: For convenience use Components with ComponentCount for iterative processing. However, be aware that while the ComponentCount of a component contains the same number of items as in the Components list for that component, ComponentCount is always 1 more than the highest Components index, because the first Components index is always 0. 输入:TWinControl,ControlsControls地解释:Lists all child controls. property Controls[Index: Integer]: TControl;DescriptionControls is an array of all the child controls. These are all controls that list this control as their Parent property. The Controls property is convenient for referring to the children of a control by number rather than name. For example, Controls may be used to iterate over all the child controls.Don't confuse the Controls property with the Components property. The Controls property lists all the controls that are child windows of the control, while the Components property lists all components that it owns. The form owns all components put on it, and therefore, they appear in the form's Components property list, even when they are child windows of a control on the form.Controls is a read-only property. To add or delete a child control, use the InsertControl or RemoveControl methods. To move a child control from one parent to another, set the Parent of the child control, as that will handle both the RemoveControl from the original parent and the InsertControl to the new parent.如果你说你英文不好,不爱看。那就算我没有说……
i: Integer;
begin
for i := 0 to self.ControlCount - 1 do
if self.Controls[i] is TCheckBox then
if TCheckBox(self.Controls[i]).Checked then
有被选中的...
end;
Controls
luck!
i: Integer;
begin
for i := 0 to panel1.ControlCount - 1 do
if panel1.Controls[i] is TCheckBox then
if TCheckBox(panel1.Controls[i]).Checked then
有被选中的...
end;
var
i,a:integer;
begin
for i:=0 to Form1.ComponentCount-1 do
begin
if Form1.Components[i] is TEdit then
Form1.Components[i].Visible:=false;///////这个不能通过
end;
end;Components与controls什么区别啊 ?
i: Integer;
begin
for i := 0 to ComponentCount - 1 do
if ((Components[i] is TCheckBox) and (Components[i] as TCheckBox).Checked) then
有被选中的...
end;
5个星就牛X啊
d里的所有class你都用通了,
你你们牛X 你机器键盘是不是没有F1啊
你来论坛从来没问过问题,就是为了回答问题和埋汰别人的吧