vb動態控制元件陣列

2023-01-19 04:20:27 字數 1374 閱讀 3587

1樓:

最基本的方法就是這樣,根據需要寫成迴圈也行load command1(1)

command1(1).left = 200command1(1).top = 1000command1(1).visible = trueload command1(2)

command1(2).left = 1800command1(2).top = 1000command1(2).visible = trueload command1(3)

command1(3).left = 3400command1(3).top = 1000command1(3).visible = trueload command1(4)

command1(4).left = 200command1(4).top = 2000command1(4).visible = trueload command1(5)

command1(5).left = 1800command1(5).top = 2000command1(5).visible = trueload command1(6)

command1(6).left = 3400command1(6).top = 2000command1(6).visible = trueload command1(7)

command1(7).left = 200command1(7).top = 3000command1(7).visible = trueload command1(8)

command1(8).left = 1800command1(8).top = 3000command1(8).visible = trueload command1(9)

command1(9).left = 3400command1(9).top = 3000command1(9).visible = true

2樓:匿名使用者

private sub command1_click(index as integer)

for i = 1 to 8

load command1(i)

with command1(i)

.visible = true

.caption = i

if (i mod 3) = 0 then.move command1(i - 3).left, command1(i - 3).

top + command1(i - 3).height + 120

else

.move command1(i - 1).left + command1(i - 1).width + 120, command1(i - 1).top

end if

end with

next i

end sub

vb陣列插入,陣列元素的插入 VB

1 text2中的內容是由手工輸入還是由電腦隨機生成?2 插入的位置如何界定?比如輸入1,是插入第一個元素的前面還是後面?vb這樣在陣列中新增新資料?沒有好方法,只能用迴圈把插入點以後的所有元素後移一個,然後在插入點寫入新增的資料。給你一個方法,但是 來不及幫你寫了 1 陣列自己可以定義成不定大小的...

VB在textbox中輸出陣列,VB給陣列賦值後如何在文字框Text裡輸出

private sub form load dim a 1 to 1000 as integer 在text的屬性欄設定這2個屬性 text1.scrollbars 2 vertical text1.multiline truetext1.text for i 1 to 1000 a i i tex...

vb的tet控制元件怎麼換行,VB的TEXT控制元件怎麼換行

除設定文字框屬性multiline為true外,如下 private sub form load text1 123 vbnewline 456 end sub 1,先在窗體新增 text1控制元件 2,設定 text1.multiline true3,在text1控制元件顯示中,新增換行資訊,如 ...