循环与字段名称 [英] loop with field names

查看:58
本文介绍了循环与字段名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我想要的东西就像我在MS Access中使用的那样:


for i = 1到20

me(" FieldName"& i).Text =" Text bla bla bla"

next i


我想要类似的东西因为我有一系列字段,比如

FieldName1; FieldName2,FieldName3,...我要填写

programmaticaly。


提前感谢


Filip

解决方案

Filip,


有什么问题?
我想要像我在MS Access中使用的那样:

我= 1到20
我(FieldName& i).Text =" Text bla bla bla"
next i



\\\ 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


< blockquote>感谢和抱歉在错误的论坛发帖


Filip,


没有消息要告诉你这是错误的论坛,只是告诉你

在我的意见中有一个比你更好的问题,你有这个问题

并且你想了解更多它。


也许我在那个新闻组中也回答了这个问题,但是有更多的人可以回答这个问题而不是在这里


(虽然在有人理解错误之前我不是唯一一个

可以回答你问题的人)。


Cor

感谢和抱歉在错误的论坛上发帖




Hi everybody,

I want something like I used in MS Access:

for i = 1 to 20
me("FieldName" & i).Text = "Text bla bla bla"
next i

I want something like that because I have a series of fields like
FieldName1; FieldName2, FieldName3, ... which I want to fill in
programmaticaly.

thanks in advance

Filip

解决方案

Filip,

What is the problem with that


I want something like I used in MS Access:

for i = 1 to 20
me("FieldName" & i).Text = "Text bla bla bla"
next i


\\\by instance roughly typed
for ctr in me.controls
dim number as integer = Cint(ctr.text.substring(9,0))
if number. > 0 AndAlso number < 21 then
ctr.text = "Text bla bla bla"
end if
Next
///
Did you know that there is a newsgroup
Microsoft.public.dotnet.languages.vb

There 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 own
controlcollection, so when this is on a frame you have not to say "me",
however "frame1" or whatever.

I hope this helps?

Cor


thanks and sorry for posting in the wrong forum


Filip,

Was no message to tell you that this is the wrong forum, only to tell you
that there is in my opinon a better one than this for the question you had
and you want to know more of it.

Maybe I had answered that as well in that newsgroup, however there are more
who can answer the question than here

(Although before someone understand it wrong I am not the only one here who
can answer your question).

Cor

thanks and sorry for posting in the wrong forum




这篇关于循环与字段名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆