Public Class Form1

    Dim WithEvents RC As New iRobots.RoCar01
    Dim a(1) As Integer

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim i As Integer = 0
        Dim temp As Integer
        If RadioButton1.Checked Then
            If CheckBox1.Checked Then
                a(i) = CheckBox1.Text
                i += 1
            End If
            If CheckBox2.Checked Then
                a(i) = CheckBox2.Text
                i += 1
            End If
            If CheckBox3.Checked Then
                a(i) = CheckBox3.Text
                i += 1
            End If
            If CheckBox4.Checked Then
                a(i) = CheckBox4.Text
                i += 1
            End If
            If CheckBox5.Checked Then
                a(i) = CheckBox5.Text
                i += 1
            End If
            If CheckBox6.Checked Then
                a(i) = CheckBox6.Text
                i += 1
            End If
            If CheckBox7.Checked Then
                a(i) = CheckBox7.Text
                i += 1
            End If
            If CheckBox8.Checked Then
                a(i) = CheckBox8.Text
                i += 1
            End If
            If CheckBox9.Checked Then
                a(i) = CheckBox9.Text
                i += 1
            End If
            temp = a(0) + a(1)
            If Len(temp) = 1 Then
                RC.SSDisplayOut(1, 0)
                RC.SSDisplayOut(2, temp)
            Else
                RC.SSDisplayOut(1, Strings.Left(temp, 1))
                RC.SSDisplayOut(2, Strings.Right(temp, 1))
            End If
        End If

        If RadioButton2.Checked Then
            If CheckBox1.Checked Then
                a(i) = CheckBox1.Text
                i += 1
            End If
            If CheckBox2.Checked Then
                a(i) = CheckBox2.Text
                i += 1
            End If
            If CheckBox3.Checked Then
                a(i) = CheckBox3.Text
                i += 1
            End If
            If CheckBox4.Checked Then
                a(i) = CheckBox4.Text
                i += 1
            End If
            If CheckBox5.Checked Then
                a(i) = CheckBox5.Text
                i += 1
            End If
            If CheckBox6.Checked Then
                a(i) = CheckBox6.Text
                i += 1
            End If
            If CheckBox7.Checked Then
                a(i) = CheckBox7.Text
                i += 1
            End If
            If CheckBox8.Checked Then
                a(i) = CheckBox8.Text
                i += 1
            End If
            If CheckBox9.Checked Then
                a(i) = CheckBox9.Text
                i += 1
            End If
            temp = a(0) * a(1)
            If Len(temp) = 1 Then
                RC.SSDisplayOut(1, 0)
                RC.SSDisplayOut(2, temp)
            Else
                RC.SSDisplayOut(1, Strings.Left(temp, 1))
                RC.SSDisplayOut(2, Strings.Right(temp, 1))
            End If
        End If

    End Sub
End Class
