- var
- i:integer;
- begin
- for i:=0 to GroupBox1.ControlCount-1 do
- begin
- if GroupBox1.Controls[i].ClassType=tedit then
- begin
- (GroupBox1.Controls[i] as tedit).Text:='';
- end;
- if GroupBox1.Controls[i].ClassType=TComboBox then
- begin
- (GroupBox1.Controls[i] as TComboBox).ItemIndex:=-1;
- end;
- end;
遍历groupbox1的所有控件,让edit和combobox为空
清空控件组内输入
最新推荐文章于 2024-06-10 23:48:59 发布
此代码段展示了如何遍历一个控件组 (GroupBox1) 中的所有子控件,并清空文本框 (TEdit) 的内容及将组合框 (TComboBox) 的选择项设置为无效,以实现界面初始化。
4万+

被折叠的 条评论
为什么被折叠?



