本文介绍了循环与字段名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 大家好, 我想要的东西就像我在MS Access中使用的那样: for i = 1到20 me(" FieldName"& i).Text =" Text bla bla bla" next i 我想要类似的东西因为我有一系列字段,比如 FieldName1; FieldName2,FieldName3,...我要填写 programmaticaly。 提前感谢 Filip 解决方案 \\\ by实例大致输入 for ctr in me.controls dim number as integer = Cint(ctr.text.substring(9,0)) 如果是数字。 > 0和其他数字< 21然后 ctr.text =" Text bla bla bla" end if Next // / 您是否知道有新闻组 Microsoft.public.dotnet.languages.vb 你可以得到很多方法(我采取了最简单的方法) 请记住,在dotNet窗口中,每个控件都可以拥有自己的 控件集,所以如果这是在一个框架上你不必说我, 但是frame1或者其他什么。 我希望这有帮助吗? Cor 感谢和抱歉在错误的论坛发帖 Hi everybody,I want something like I used in MS Access:for i = 1 to 20me("FieldName" & i).Text = "Text bla bla bla"next iI want something like that because I have a series of fields likeFieldName1; FieldName2, FieldName3, ... which I want to fill inprogrammaticaly.thanks in advanceFilip 解决方案\\\by instance roughly typedfor ctr in me.controlsdim number as integer = Cint(ctr.text.substring(9,0))if number. > 0 AndAlso number < 21 thenctr.text = "Text bla bla bla"end ifNext///Did you know that there is a newsgroupMicrosoft.public.dotnet.languages.vbThere you can get a lot of methods for this (I took the most simple one)Keep in mind that in dotNet windowforms every control can have his owncontrolcollection, so when this is on a frame you have not to say "me",however "frame1" or whatever.I hope this helps?Cor 这篇关于循环与字段名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-21 07:49