So far this is what I have. If you see any ways to make the code shorter please let me know. Any other inefficiencies to be pointed out would be greatly appreciated! :c-^_^:
BTW I'm aware of the improper naming convention. If you need it I'll change it.
My Designer So Far
Public Class Form1
Dim ButtonClickNum As Integer = 0
Dim Button2ClickNum As Integer = 0
Dim Choice1 As String
Dim Choice2 As String
Dim Choice3 As String
Dim Choice4 As String
Dim Choice5 As String
Dim Choice6 As String
Dim Choice7 As String
Dim Choice8 As String
Dim Choice9 As String
Dim Choice10 As String
Dim Choice11 As String
Dim Choice12 As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ButtonClickNum = ButtonClickNum + 1
If ButtonClickNum = 1 Then
Choice1 = TextBox1.Text
ListBox1.Items.Add("1. " + TextBox1.Text)
End If
If ButtonClickNum = 2 Then
Choice2 = TextBox1.Text
ListBox1.Items.Add("2. " + TextBox1.Text)
End If
If ButtonClickNum = 3 Then
Choice3 = TextBox1.Text
ListBox1.Items.Add("3. " + TextBox1.Text)
End If
If ButtonClickNum = 4 Then
Choice4 = TextBox1.Text
ListBox1.Items.Add("4. " + TextBox1.Text)
End If
If ButtonClickNum = 5 Then
Choice5 = TextBox1.Text
ListBox1.Items.Add("5. " + TextBox1.Text)
End If
If ButtonClickNum = 6 Then
Choice6 = TextBox1.Text
ListBox1.Items.Add("6. " + TextBox1.Text)
End If
If ButtonClickNum = 7 Then
Choice7 = TextBox1.Text
ListBox1.Items.Add("7. " + TextBox1.Text)
End If
If ButtonClickNum = 8 Then
Choice8 = TextBox1.Text
ListBox1.Items.Add("8. " + TextBox1.Text)
End If
If ButtonClickNum = 9 Then
Choice9 = TextBox1.Text
ListBox1.Items.Add("9. " + TextBox1.Text)
End If
If ButtonClickNum = 10 Then
Choice10 = TextBox1.Text
ListBox1.Items.Add("10. " + TextBox1.Text)
End If
If ButtonClickNum = 11 Then
Choice11 = TextBox1.Text
ListBox1.Items.Add("11. " + TextBox1.Text)
End If
If ButtonClickNum = 12 Then
Choice12 = TextBox1.Text
ListBox1.Items.Add("12. " + TextBox1.Text)
Button1.Enabled = False
Button2.Visible = True
End If
End Sub
Private Sub ResetToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ResetToolStripMenuItem.Click
TextBox1.Text = ""
ListBox1.Items.Clear()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Label1.Visible = True
TextBox2.Visible = True
Button3.Visible = True
Button2ClickNum = Button2ClickNum + 1
If Button2ClickNum = 1 Then
Label1.Text = "How many matches for: " + Choice1 + "?"
End If
If Button2ClickNum = 2 Then
Label1.Text = "How many matches for: " + Choice2 + "?"
End If
If Button2ClickNum = 3 Then
Label1.Text = "How many matches for: " + Choice3 + "?"
End If
If Button2ClickNum = 4 Then
Label1.Text = "How many matches for: " + Choice4 + "?"
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If Button2ClickNum = 1 Then
Label1.Text = "How many matches for: " + Choice1 + "?"
End If
If Button2ClickNum = 2 Then
Label1.Text = "How many matches for: " + Choice2 + "?"
End If
If Button2ClickNum = 3 Then
Label1.Text = "How many matches for: " + Choice3 + "?"
End If
If Button2ClickNum = 4 Then
Label1.Text = "How many matches for: " + Choice4 + "?"
End If
End Sub


Sign In
Create Account



Back to top









