需要一些数组帮助。 [英] Need some array help.
问题描述
这可能吗?我想将一个数组传递给一个包含
txtBox.Text属性的函数......我在想这样的东西,但是我知道它不会工作
Dim vendorFields(9)As String
vendorFields(0)=" txtVendorName.Text"
vendorFields(1)=" txtVendorStreetAddress.Text"
vendorFields(2)=" txtVendorCity.Text"
....
vendorFields(2)=" 111 Star Ave"
但我真的希望它翻译为
txtVendorStreetAddress.Text =" 111 Star Ave"
我知道我的逻辑搞砸了,这是否可能,如果是这样,我该怎么做?
呢?谢谢
Is this possible? I want to pass an array into a function that contains
txtBox.Text properties... I was thinking something like this, but I
know it won''t work
Dim vendorFields(9) As String
vendorFields(0) = "txtVendorName.Text"
vendorFields(1) = "txtVendorStreetAddress.Text"
vendorFields(2) = "txtVendorCity.Text"
....
vendorFields(2) = "111 Star Ave"
but really i want it to translate as
txtVendorStreetAddress.Text = "111 Star Ave"
I know my logic is messed up, is this possible, and if so how coud I do
it? Thanks
推荐答案
James,
为什么不是一组文本框
将myTextBoxes()调暗为Textbox = {txtVendorName,txtVendorStreet等}
venodorfields(2).Text =" 111StarAvenue"
我希望这会有所帮助,
Cor
" James" < ja ********** @ gmail.comschreef在bericht
新闻:11 ******************** *@m73g2000cwd.googlegro ups.com ...
James,
Why not an array of textboxes
dim myTextBoxes() as Textbox = {txtVendorName,txtVendorStreet,etc}
venodorfields(2).Text = "111StarAvenue"
I hope this helps,
Cor
"James" <ja**********@gmail.comschreef in bericht
news:11*********************@m73g2000cwd.googlegro ups.com...
这可能吗?我想将一个数组传递给一个包含
txtBox.Text属性的函数......我在想这样的东西,但是我知道它不会工作
Dim vendorFields(9)As String
vendorFields(0)=" txtVendorName.Text"
vendorFields(1)=" txtVendorStreetAddress.Text"
vendorFields(2)=" txtVendorCity.Text"
...
vendorFields(2)=" 111 Star Ave"
但我真的希望它翻译为
txtVendorStreetAddress.Text = 111 Star Ave
我知道我的逻辑搞砸了,这是可能的,如果是这样,我该怎么做?b
?谢谢
Is this possible? I want to pass an array into a function that contains
txtBox.Text properties... I was thinking something like this, but I
know it won''t work
Dim vendorFields(9) As String
vendorFields(0) = "txtVendorName.Text"
vendorFields(1) = "txtVendorStreetAddress.Text"
vendorFields(2) = "txtVendorCity.Text"
...
vendorFields(2) = "111 Star Ave"
but really i want it to translate as
txtVendorStreetAddress.Text = "111 Star Ave"
I know my logic is messed up, is this possible, and if so how coud I do
it? Thanks
嗯听起来是一个很好的解决方案,但我也有一个组合框......和
想法如何将其纳入阵列?
谢谢。
Cor Ligthert [MVP]写道:
hmmm sounds like a good solution, but i also have one combo box... and
ideas how i could incorporate that into the array?
thanks.
Cor Ligthert [MVP] wrote:
James,
为什么没有一组文本框
将myTextBoxes()调暗为Textbox = {txtVendorName,txtVendorStreet等}
venodorfields(2).Text =" 111StarAvenue"
我希望这会有所帮助,
Cor
" James" < ja ********** @ gmail.comschreef在bericht
新闻:11 ******************** *@m73g2000cwd.googlegro ups.com ...
James,
Why not an array of textboxes
dim myTextBoxes() as Textbox = {txtVendorName,txtVendorStreet,etc}
venodorfields(2).Text = "111StarAvenue"
I hope this helps,
Cor
"James" <ja**********@gmail.comschreef in bericht
news:11*********************@m73g2000cwd.googlegro ups.com...
这可能吗?我想将一个数组传递给一个包含
txtBox.Text属性的函数......我在想这样的东西,但是我知道它不会工作
Dim vendorFields(9)As String
vendorFields(0)=" txtVendorName.Text"
vendorFields(1)=" txtVendorStreetAddress.Text"
vendorFields(2)=" txtVendorCity.Text"
...
vendorFields (2)=" 111 Star Ave"
但我真的希望它翻译为
txtVendorStreetAddress.Text =" 111 Star Ave'
我知道我的逻辑搞砸了,这是可能的,如果是这样的话我该怎么做呢?b $ b b?谢谢
Is this possible? I want to pass an array into a function that contains
txtBox.Text properties... I was thinking something like this, but I
know it won''t work
Dim vendorFields(9) As String
vendorFields(0) = "txtVendorName.Text"
vendorFields(1) = "txtVendorStreetAddress.Text"
vendorFields(2) = "txtVendorCity.Text"
...
vendorFields(2) = "111 Star Ave"
but really i want it to translate as
txtVendorStreetAddress.Text = "111 Star Ave"
I know my logic is messed up, is this possible, and if so how coud I do
it? Thanks
James,
这太好了,你可以用一个组合框也好。
但是你需要更改数组
dim ctr()as controls = ........... ................
文本是来自控件的属性,因此也是文本框中的属性,如
组合框。你不需要做更多的事情,文字是继承的。
我希望这会有所帮助,
Cor
詹姆斯 < ja ********** @ gmail.comschreef在bericht
新闻:11 ******************** @ c28g2000cwb.googlegrou ps.com ...
James,
That is so nice, you can use it with a combobox too.
However than you only need to change the array as
dim ctr() as controls = ...........................
Text is a property from controls and therefore as well in the textbox as in
the combobox. You don''t have to do anything more, text is inherited.
I hope this helps,
Cor
"James" <ja**********@gmail.comschreef in bericht
news:11********************@c28g2000cwb.googlegrou ps.com...
hmmm听起来像是一个很好的解决方案,但我也有一个组合框......和
想法如何将其纳入阵列?
谢谢。
Cor Ligthert [MVP]写道:
hmmm sounds like a good solution, but i also have one combo box... and
ideas how i could incorporate that into the array?
thanks.
Cor Ligthert [MVP] wrote:
> James,
为什么没有一组文本框
将myTextBoxes()调暗为Textbox = {txtVendorName,txtVendorStreet等}
venodorfields(2).Text =" 111StarAvenue"
我希望这会有所帮助,
James" < ja ********** @ gmail.comschreef在bericht
新闻:11 ********************* @ m73g2000cwd。 googlegr oups.com ...
>James,
Why not an array of textboxes
dim myTextBoxes() as Textbox = {txtVendorName,txtVendorStreet,etc}
venodorfields(2).Text = "111StarAvenue"
I hope this helps,
Cor
"James" <ja**********@gmail.comschreef in bericht
news:11*********************@m73g2000cwd.googlegr oups.com...
这可能吗?我想将一个数组传递给一个包含
txtBox.Text属性的函数......我在想这样的东西,但是我知道它不会工作
Dim vendorFields(9)As String
vendorFields(0)=" txtVendorName.Text"
vendorFields(1)=" txtVendorStreetAddress.Text"
vendorFields(2)=" txtVendorCity.Text"
...
vendorFields(2)=" 111 Star Ave"
但我真的希望它翻译为
txtVendorStreetAddress.Text = 111 Star Ave
我知道我的逻辑搞砸了,这是可能的,如果是这样,我该怎么做?b
?谢谢
Is this possible? I want to pass an array into a function that contains
txtBox.Text properties... I was thinking something like this, but I
know it won''t work
Dim vendorFields(9) As String
vendorFields(0) = "txtVendorName.Text"
vendorFields(1) = "txtVendorStreetAddress.Text"
vendorFields(2) = "txtVendorCity.Text"
...
vendorFields(2) = "111 Star Ave"
but really i want it to translate as
txtVendorStreetAddress.Text = "111 Star Ave"
I know my logic is messed up, is this possible, and if so how coud I do
it? Thanks
这篇关于需要一些数组帮助。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!