วันศุกร์ที่ 16 มกราคม พ.ศ. 2552

Declare Array In VB.NET





' VB.NET Array Source Code

Option Explicit On
Option Strict On

Public Class Form1

Dim Rows As Byte
Dim Cols As Byte

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedToolWindow
Me.Text = " Declare Array In VB.NET "
Me.BackColor = Color.Red
ListBox1.BackColor = Color.Yellow
ListBox1.ForeColor = Color.Red
End Sub

Private Sub ListBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.Click
Dim a(10, 10) As String ' Two-Dimensional Array.
Dim b(5) As Byte ' One-Dimensional Array.
Dim c(,) As String
ReDim c(10, 10) ' Redim Array
For Rows = 0 To 10
For Cols = 0 To 10
a(Cols, Rows) = " Two-Dimensional Array In VB.NET " & " Columns : " & Cols & " Rows : " & Rows
ListBox1.Items.Add(a(Cols, Rows))
Next Cols
Next Rows

For Cols = 0 To 5
b(Cols) = Cols
ListBox1.Items.Add(b(Cols))
Next Cols

For Rows = 0 To 10
For Cols = 0 To 10
c(Cols, Rows) = " Redim Array In VB.NET " & " Columns : " & Cols & " Rows : " & Rows
ListBox1.Items.Add(c(Cols, Rows))
Next Cols
Next Rows
End Sub

End Class

' Design VB.NET Source Code Games By Fernando Firaht

ไม่มีความคิดเห็น:

แสดงความคิดเห็น