Public Class frmTable

  Inherits System.Windows.Forms.Form

  Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As _
         System.EventArgs) Handles btnCalc.Click
    Dim SquaresTable(5, 1) As Integer  ' tworzymy tablicę kwadratów liczb
    Dim MyArray(,) As Integer  ' tworzymy pustą tablicę dwuwymiarową

    '  ReDim MyArray(10, 10)

    ReDim MyArray(3, 5)        ' zmiana rozmiaru tablicy

    SquaresTable(0, 0) = 0      ' nadawanie wartości elementom tablicy
    SquaresTable(0, 1) = 0
    SquaresTable(1, 0) = 1
    SquaresTable(1, 1) = 1
    SquaresTable(2, 0) = 2
    SquaresTable(2, 1) = 4
    SquaresTable(3, 0) = 3
    SquaresTable(3, 1) = 9
    SquaresTable(4, 0) = 4
    SquaresTable(4, 1) = 16
    SquaresTable(5, 0) = 5
    SquaresTable(5, 1) = 25

    txtResult.Text = CStr(SqaresTable(CInt(txtNumber.Text), 1))
						' prezentacja wyniku

    lblResult.Visible = True
    txtResult.Visible = True

  End Sub

  Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As _
         System.EventArgs) Handles btnExit.Click
    Me.Dispose()                      ' zakończenie programu
  End Sub
End Class
