A控制阵列? [英] A-Control Array ?

查看:75
本文介绍了A控制阵列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用vb.net而且我不明白为什么没有控制

数组。

什么取代了它们。

我试图拖放(发生了什么事)并且它看起来像

没有控制数组我必须为每个控件编写代码?

那是不可能的。

我查看了帮助文件,看起来我可以设置一个事件处理程序但是

必须有一个更好的方法然后键入Handles pic1。点击,pic2.click

这将是60个控件的大量打字

I just started with vb.net and I don''t understand why there are no control
arrays.
what replaced them.
I was trying to do drag and drop(What happened with that) and it looked like
with no control array I have to write code in for every control?
That cant be possible.
I looked at the help files and it looks like I can set an event handler but
there has to be a better way then typing Handles pic1.click,pic2.click
It would be a lot of typing for 60 controls

推荐答案

Jim,


这个新闻组充满了你的问题。


术语控制阵列因为它在VB6中已经不存在了。


还有控件数组,甚至更多,每个控件都有一个控件

数组其中是孩子们再次控制。


然而,Ide中没有任何属性。数组

(集合)在父控件对象中是标准的(尽管你可以使用哈希表来模拟使用数组获取任何控件的结果

或任何其他集合/数组)。


(不要忘记VB6只有集合和数组的地方,有dotNet

更多那更动态)


表格

panel1

textbox1

textbox2

panel2

textbox3

button1


表单在其控件数组(集合)panel1和panel2

Panel1在其控制集合中有textbox1和textbox2

Panel2 .....


我希望这有帮助吗?


Cor
Jim,

This newsgroups is full of your question.

The term "Control Array" as it was in VB6 is no more.

There are still arrays of controls, even more, every control has a control
array where in are the childs controls again.

However there is not any more a property for that in the Ide. The array
(collection) is standard in the parent control object (although you can
simulate tho get any control using an array by instance using an hashtable
or any other collection/array).

(Do not forget where VB6 has only the collection and the array, has dotNet
much more for that and much more dynamicly)

Form
panel1
textbox1
textbox2
panel2
textbox3
button1

Form has in its control array (collection) panel1 and panel2
Panel1 has in its control collection textbox1 and textbox2
Panel2.....

I hope this helps?

Cor


Jim,


这个新闻组充满了你的问题。


术语控制阵列因为它在VB6中已经不存在了。


还有控件数组,甚至更多,每个控件都有一个控件

数组其中是孩子们再次控制。


然而,Ide中没有任何属性。数组

(集合)在父控件对象中是标准的(尽管你可以使用哈希表来模拟使用数组获取任何控件的结果

或任何其他集合/数组)。


(不要忘记VB6只有集合和数组的地方,有dotNet

更多那更动态)


表格

panel1

textbox1

textbox2

panel2

textbox3

button1


表单在其控件数组(集合)panel1和panel2

Panel1在其控制集合中有textbox1和textbox2

Panel2 .....


我希望这有帮助吗?


Cor
Jim,

This newsgroups is full of your question.

The term "Control Array" as it was in VB6 is no more.

There are still arrays of controls, even more, every control has a control
array where in are the childs controls again.

However there is not any more a property for that in the Ide. The array
(collection) is standard in the parent control object (although you can
simulate tho get any control using an array by instance using an hashtable
or any other collection/array).

(Do not forget where VB6 has only the collection and the array, has dotNet
much more for that and much more dynamicly)

Form
panel1
textbox1
textbox2
panel2
textbox3
button1

Form has in its control array (collection) panel1 and panel2
Panel1 has in its control collection textbox1 and textbox2
Panel2.....

I hope this helps?

Cor


On Mon,2005年1月10日10:06:46 -0500,Jim Burns <籍**** @ comcast.net>写道:

$ b $b¤我刚开始使用vb.net而且我不明白为什么没有控件
$ b $b¤数组。
$ b $b¤什么取代了它们。
$ b $b¤我试图拖拉(发生了什么事)并且它看起来像
$ b $b¤没有控制阵列我有为每个控件编写代码?
$ b $b¤那是不可能的。
$ b $b¤我查看了帮助文件,看起来我可以设置一个事件处理程序但是
$ b $b¤必须有一个更好的方法然后输入Handles pic1.click,pic2.click
$ b $b¤这将是60个控件的很多打字

这几乎是推荐的方法,因为控件没有内置的索引属性。

http://msdn.microsoft.com/library/de...albasicnet.asp

Paul ~~~ pc ****** @ ameritech.net

Microsoft MVP(Visual Basic)
On Mon, 10 Jan 2005 10:06:46 -0500, "Jim Burns" <Ji****@comcast.net> wrote:

¤ I just started with vb.net and I don''t understand why there are no control
¤ arrays.
¤ what replaced them.
¤ I was trying to do drag and drop(What happened with that) and it looked like
¤ with no control array I have to write code in for every control?
¤ That cant be possible.
¤ I looked at the help files and it looks like I can set an event handler but
¤ there has to be a better way then typing Handles pic1.click,pic2.click
¤ It would be a lot of typing for 60 controls

That is pretty much the recommended method since controls have no built-in index property.

http://msdn.microsoft.com/library/de...albasicnet.asp
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)


这篇关于A控制阵列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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