vb.net 数组赋值问题
久没有捡专业了,现在想写个数组都成了问题定义个动态数组比如x(,),想实现x(0,0)=0x(0,1)=0x(0,2)=0x(0,3)=1x(0,4)=1x(0,5)=1...
久没有捡专业了,现在想写个数组都成了问题定义个动态数组比如x(,),想实现x(0,0)=0x(0,1)=0x(0,2)=0x(0,3)=1x(0,4)=1x(0,5)=1x(0,6)=2x(0,7)=2x(0,8)=2这样类型的数据,每3个为同一值,怎么搞啊
展开
展开全部
vb.net已经去掉了控件数组这个类,不过有个代替该方式的一个属性:tag,你可以把这些关联的tag属性设置为同一标记,如:a。然后遍历所有的checkbox并且tag为a的则选定:
protected
sub
chkall_click()
for
each
ctl
as
control
in
me.controls
''如果checkbox在一个容器里,比如groupbox,那可以用groupbox.controls
if
ctl.gettype().name.tolower()
=
"checkbox"
then
ctype(ctl,
checkbox).checked
=
checkbox3.checked
end
if
next
end
sub
protected
sub
chkall_click()
for
each
ctl
as
control
in
me.controls
''如果checkbox在一个容器里,比如groupbox,那可以用groupbox.controls
if
ctl.gettype().name.tolower()
=
"checkbox"
then
ctype(ctl,
checkbox).checked
=
checkbox3.checked
end
if
next
end
sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
我刚打开写了一下,基本就是你这样的,嵌套一层
大括号
一维,看着啊
Dim
a(,,)
As
Integer
=
New
Integer(,,)
{{{11,
12,
13},
{21,
22,
23},
{31,
32,
33}},
{{41,
42,
43},
{51,
52,
53},
{61,
62,
63}},
{{71,
72,
73},
{81,
82,
83},
{91,
92,
93}}}
大括号
一维,看着啊
Dim
a(,,)
As
Integer
=
New
Integer(,,)
{{{11,
12,
13},
{21,
22,
23},
{31,
32,
33}},
{{41,
42,
43},
{51,
52,
53},
{61,
62,
63}},
{{71,
72,
73},
{81,
82,
83},
{91,
92,
93}}}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
方法一:
Dim x(,) As Integer
Dim i As Integer
ReDim x(0, 8)
For i = 0 To 8
x(0, i) = i \ 3
Next
方法二:
Dim x(,) As Integer
Dim i As Integer
For i = 0 To 8
ReDim Preserve x(0, i)
x(0, i) = i \ 3
Next
Dim x(,) As Integer
Dim i As Integer
ReDim x(0, 8)
For i = 0 To 8
x(0, i) = i \ 3
Next
方法二:
Dim x(,) As Integer
Dim i As Integer
For i = 0 To 8
ReDim Preserve x(0, i)
x(0, i) = i \ 3
Next
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询