vb数组练习题(vb net数组)

2023-06-10 11:27:18 来源:城市网 分享到:

1、数组的定义:

2、Dim strName(9) As String


(相关资料图)

3、Private Sub btnArrayElement_Click(sender As Object,

4、 e As EventArgs) Handles btnArrayElement.Click

5、 "Clear the list

6、 ClearList()

7、 "Declare an array

8、 Dim strFriends(4) As String

9、 "Populate the array

10、 strFriends(0)="Wendy"

11、 strFriends(1)="Harriet"

12、 strFriends(2)="Jay"

13、 strFriends(3)="Michelle"

14、 strFriends(4)="Richard"

15、 "Add the first array item to the list

16、 lstFriends.Items.Add(strFriends(0))

17、 End Sub

18、"Now create the following procedure:

19、Private Sub ClearList()

20、 "Clear the list

21、 lstFriends.Items.Clear()

22、End Sub

23、"Declare an array

24、Dim strFriends(4) As String

25、"Populate the array

26、strFriends(0)="Wendy"

27、strFriends(1)="Harriet"

28、strFriends(2)="Jay"

29、strFriends(3)="Michelle"

30、strFriends(4)="Richard"

31、"Add the first array item to the list

32、lstFriends.Items.Add(strFriends(0))

33、表单界面如下:

本文到此结束,希望对大家有所帮助。

本文由用户上传,如有侵权请联系删除!

关键词:

Copyright   2015-2022 热讯城建网 版权所有  备案号:豫ICP备20005723号-6   联系邮箱:29 59 11 57 8@qq.com