|
-
Apr 1st, 2007, 06:38 PM
#1
Thread Starter
New Member
I need some Help (Sudoku Gen)
Hey everyone,
I'm creating a Sudoku code with Visual Basics 2005 Express. However, an error appears saying the code is on a infinite loop
Code:
Private Sub Sudoku_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged, TextBox2.TextChanged, TextBox3.TextChanged, TextBox4.TextChanged, TextBox5.TextChanged, TextBox6.TextChanged, TextBox7.TextChanged, TextBox8.TextChanged, TextBox9.TextChanged, TextBox10.TextChanged, TextBox11.TextChanged, TextBox12.TextChanged, TextBox13.TextChanged, TextBox14.TextChanged, TextBox15.TextChanged, TextBox16.TextChanged, TextBox17.TextChanged, TextBox18.TextChanged, TextBox19.TextChanged, TextBox20.TextChanged, TextBox21.TextChanged, TextBox22.TextChanged, TextBox23.TextChanged, TextBox24.TextChanged, TextBox25.TextChanged, TextBox26.TextChanged, TextBox27.TextChanged, TextBox28.TextChanged, TextBox28.TextChanged, TextBox29.TextChanged, TextBox30.TextChanged, TextBox31.TextChanged, TextBox32.TextChanged, TextBox33.TextChanged, TextBox34.TextChanged, TextBox35.TextChanged, TextBox36.TextChanged, TextBox37.TextChanged, TextBox38.TextChanged, TextBox39.TextChanged, TextBox40.TextChanged, TextBox41.TextChanged, TextBox42.TextChanged, TextBox43.TextChanged, TextBox44.TextChanged, TextBox45.TextChanged, TextBox46.TextChanged, TextBox47.TextChanged, TextBox48.TextChanged, TextBox49.TextChanged, TextBox50.TextChanged, TextBox51.TextChanged, TextBox52.TextChanged, TextBox53.TextChanged, TextBox54.TextChanged, TextBox55.TextChanged, TextBox56.TextChanged, TextBox57.TextChanged, TextBox58.TextChanged, TextBox59.TextChanged, TextBox60.TextChanged, TextBox61.TextChanged, TextBox62.TextChanged, TextBox63.TextChanged, TextBox64.TextChanged, TextBox65.TextChanged, TextBox66.TextChanged, TextBox67.TextChanged, TextBox68.TextChanged, TextBox69.TextChanged, TextBox70.TextChanged, TextBox71.TextChanged, TextBox72.TextChanged, TextBox73.TextChanged, TextBox74.TextChanged, TextBox75.TextChanged, TextBox76.TextChanged, TextBox77.TextChanged, TextBox78.TextChanged, TextBox79.TextChanged, TextBox80.TextChanged, TextBox81.TextChanged
Dim a As Integer
Dim solfound As Boolean = True
Dim textbox As TextBox = CType(sender, TextBox)
If Not SolutionShwn Then
If textbox.Text = "" Then
textbox.Text = "1"
ElseIf textbox.Text = "9" Then
textbox.Text = ""
Else
textbox.Text = Trim(Str(CInt(textbox.Text) + 1))
End If
For a = 1 To 81
If txtbox(a).Text <> Sudokusolution(a) Then
solfound = True
Exit For
End If
Next a
congrats.Visible = solfound
End If
End Sub
The
Code:
textbox.Text = Trim(Str(CInt(textbox.Text) + 1))
Line reports an infinite loop, but I can't seem to fix the problem, any help would be greatly appreciated, thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|