2017年10月14日 星期六

乘法表



Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim A, B, C, I, J As Integer
        Dim S1 As String
        S1 = Space(4)
        A = Val(TextBox2.Text)
        B = Val(TextBox3.Text)
        If A >= 19 Then
            A = 19
            TextBox2.Text = A.ToString
        End If

        If B >= 19 Then
            B = 19
            TextBox3.Text = B.ToString
        End If

        TextBox1.Clear()

        For I = 1 To A Step 1
            For J = 1 To B Step 1
                C = I * J
                TextBox1.Text = TextBox1.Text + S1
                TextBox1.Text = TextBox1.Text + C.ToString
                If J = B Then
                    TextBox1.Text = TextBox1.Text & vbNewLine & vbNewLine
                End If
            Next J

        Next I
    End Sub
End Class

沒有留言:

張貼留言

Fultter APP控制 WOKWI ESP32 RFID+LED (使用flutter_windows_3.19.1-stable Visual studio 1.108.2 )

Fultter APP控制 WOKWI ESP32 RFID+LED (使用flutter_windows_3.19.1-stable  Visual studio  1.108.2 ) 1) Android studio 環境設定 2) Visual studio  1.108...