关于简化问题!!!各位帮忙看看!!!!!!!
程序代码:
[local]1[/local] Private Sub Command1_Click() Call 写入INI("Form设置", "Text1", Text1.Text) Call 写入INI("Form设置", "Text2", Text2.Text) Call 写入INI("Form设置", "Text3", Text3.Text) ' Call 写入INI("Form设置", "Text4", Text4.Text) Call 写入INI("Form设置", "Text5", Text5.Text) Call 写入INI("Form设置", "Text6", Text6.Text) Call 写入INI("Form设置", "Text7", Text7.Text) Call 写入INI("Form设置", "Text8", Text8.Text) Call 写入INI("Form设置", "Text9", Text9.Text) Call 写入INI("Form设置", "Text10", Text10.Text) Call 写入INI("Form设置", "Text11", Text11.Text) Call 写入INI("Form设置", "Text12", Text12.Text) Call 写入INI("Form设置", "Text13", Text13.Text) Call 写入INI("Form设置", "Text14", Text14.Text) Call 写入INI("Form设置", "Text15", Text15.Text) Call 写入INI("Form设置", "Text16", Text16.Text) Call 写入INI("Form设置", "Text17", Text17.Text) Call 写入INI("Form设置", "Text18", Text18.Text) Call 写入INI("Form设置", "Text19", Text19.Text) Call 写入INI("Form设置", "Text20", Text20.Text) Call 写入INI("Form设置", "Text21", Text21.Text) Call 写入INI("Form设置", "Text22", Text22.Text) Call 写入INI("Form设置", "Text26", Text26.Text) Call 写入INI("Form设置", "Text24", Text24.Text) Call 写入INI("Form设置", "Text25", Text25.Text) Call 写入INI("Form设置", "Text26", Text26.Text) Call 写入INI("Form设置", "Text27", Text27.Text) Call 写入INI("Form设置", "Text28", Text28.Text) Call 写入INI("Form设置", "Text29", Text29.Text) Call 写入INI("Form设置", "Text30", Text30.Text) ' Call 写入INI("Form设置", "Text31", Text31.Text) ' Call 写入INI("Form设置", "Text32", Text32.Text) ' Call 写入INI("Form设置", "Text33", Text33.Text) ' Call 写入INI("Form设置", "Text34", Text34.Text) End Sub Private Sub Command2_Click() Text1 = 读取INI("Form设置", "Text1", "默认值") Text2 = 读取INI("Form设置", "Text2", "默认值") Text3 = 读取INI("Form设置", "Text3", "默认值") Text4 = 读取INI("Form设置", "Text4", "默认值") Text5 = 读取INI("Form设置", "Text5", "默认值") Text6 = 读取INI("Form设置", "Text6", "默认值") Text7 = 读取INI("Form设置", "Text7", "默认值") Text8 = 读取INI("Form设置", "Text8", "默认值") Text9 = 读取INI("Form设置", "Text9", "默认值") Text10 = 读取INI("Form设置", "Text10", "默认值") Text11 = 读取INI("Form设置", "Text11", "默认值") Text12 = 读取INI("Form设置", "Text12", "默认值") Text13 = 读取INI("Form设置", "Text13", "默认值") Text14 = 读取INI("Form设置", "Text14", "默认值") Text15 = 读取INI("Form设置", "Text15", "默认值") Text16 = 读取INI("Form设置", "Text16", "默认值") Text17 = 读取INI("Form设置", "Text17", "默认值") Text18 = 读取INI("Form设置", "Text18", "默认值") Text19 = 读取INI("Form设置", "Text19", "默认值") Text20 = 读取INI("Form设置", "Text20", "默认值") Text21 = 读取INI("Form设置", "Text21", "默认值") Text22 = 读取INI("Form设置", "Text22", "默认值") Text24 = 读取INI("Form设置", "Text24", "默认值") Text25 = 读取INI("Form设置", "Text25", "默认值") Text26 = 读取INI("Form设置", "Text26", "默认值") Text27 = 读取INI("Form设置", "Text27", "默认值") Text28 = 读取INI("Form设置", "Text28", "默认值") Text29 = 读取INI("Form设置", "Text29", "默认值") Text30 = 读取INI("Form设置", "Text30", "默认值") 我想把这个代码简化一下! 思路是列如: a=Text(i) + 1 Call 写入INI("Form设置", "& a &", a.Text) 具体应该怎么书写啊,不然控件多了就一老大一串!麻烦各位了!!!
[ 本帖最后由 qiziyun 于 2013-2-4 06:07 编辑 ]