Visual basics 2010 Fehlermeldung.

GoodForYou

Lt. Junior Grade
Registriert
Juli 2013
Beiträge
285
Hey brauche hilfe ;)
wenn ich mein Tic Tac Toe testen möchste, also ob die befehle richtig gesendet werden kommt immer eine fehlermeldung. Also um zu testen drücke ich auf folgenden Grünen Pfeil : 3.png
Dann kommt diese Meldung 1.png und dann dieser Fehler : 2.png

Gruß
Vielleicht hatte ja auch jemand das Programm.. falls überhaupt jemand hier Virsual Basics 2010 benutz.
 
Da sind Fehler vorhanden. Die müsstest du erstmal beseitigen, um das Programm überhaupt kompilieren zu können.
Diese Fehler werden normalerweise am Rand des Quelltextes markiert und in der Fehlerkonsole(?) Fehlerliste angezeigt.

Wenn du den "letzten erfolgreichen Build" ausführen möchtest, muss der natürlich überhaupt vorhanden sein, was hier scheinbar nicht der Fall ist.
 
Zuletzt bearbeitet:
Also ein Fehler im Code?
Was ist den hierran falsch?
Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Label1.Text = "X" Then
Button1.Text = "X"
Label1.Text = "0"
Else
Button1.Text = "0"
Label1.Text = "X"
End If
Call win()
Button1.Enabled = False
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If Label1.Text = "X" Then
Button2.Text = "X"
Label1.Text = "0"
Else
Button2.Text = "0"
Label1.Text = "X"
End If
Call win()
Button2.Enabled = False
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If Label1.Text = "X" Then
Button3.Text = "X"
Label1.Text = "0"
Else
Button3.Text = "0"
Label1.Text = "X"
End If
Call win()
Button3.Enabled = False
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
If Label1.Text = "X" Then
Button4.Text = "X"
Label1.Text = "0"
Else
Button4.Text = "0"
Label1.Text = "X"
End If
Button4.Enabled = False
Call win()
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
If Label1.Text = "X" Then
Button5.Text = "X"
Label1.Text = "0"
Else
Button5.Text = "0"
Label1.Text = "X"
End If
Call win()
Button5.Enabled = False
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
If Label1.Text = "X" Then
Button6.Text = "X"
Label1.Text = "0"
Else
Button6.Text = "0"
Label1.Text = "X"
End If
Call win()
Button6.Enabled = False
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
If Label1.Text = "X" Then
Button7.Text = "X"
Label1.Text = "0"
Else
Button7.Text = "0"
Label1.Text = "X"
End If
Call win()
Button7.Enabled = False
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
If Label1.Text = "X" Then
Button8.Text = "X"
Label1.Text = "0"
Else
Button8.Text = "0"
Label1.Text = "X"
End If
Call win()
Button8.Enabled = False
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
If Label1.Text = "X" Then
Button9.Text = "X"
Label1.Text = "0"
Else
Button9.Text = "0"
Label1.Text = "X"
End If
Call win()
Button9.Enabled = False
End Sub
Private Sub win()
If Button1.Text = "X" And Button2.Text = "X" And Button3.Text = "X" Then
Label2.Text = "X wins"
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End If
If Button4.Text = "X" And Button5.Text = "X" And Button6.Text = "X" Then
Label2.Text = "X wins"
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End If
If Button7.Text = "X" And Button8.Text = "X" And Button9.Text = "X" Then
Label2.Text = "X wins"
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End If
If Button1.Text = "X" And Button4.Text = "X" And Button7.Text = "X" Then
Label2.Text = "X wins"
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End If
If Button2.Text = "X" And Button5.Text = "X" And Button8.Text = "X" Then
Label2.Text = "X wins"
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End If
If Button3.Text = "X" And Button6.Text = "X" And Button9.Text = "X" Then
Label2.Text = "X wins"
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End If
If Button1.Text = "X" And Button5.Text = "X" And Button9.Text = "X" Then
Label2.Text = "X wins"
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End If
If Button3.Text = "X" And Button5.Text = "X" And Button7.Text = "X" Then
Label2.Text = "X wins"
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End If
If Button1.Text = "0" And Button2.Text = "0" And Button3.Text = "0" Then
Label2.Text = "0 wins"
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End If
If Button4.Text = "0" And Button5.Text = "0" And Button6.Text = "0" Then
Label2.Text = "0 wins"
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End If
If Button7.Text = "0" And Button8.Text = "0" And Button9.Text = "0" Then
Label2.Text = "0 wins"
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End If
If Button1.Text = "0" And Button4.Text = "0" And Button7.Text = "0" Then
Label2.Text = "0 wins"
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End If
If Button2.Text = "0" And Button5.Text = "0" And Button8.Text = "0" Then
Label2.Text = "0 wins"
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End If
If Button3.Text = "0" And Button6.Text = "0" And Button9.Text = "0" Then
Label2.Text = "0 wins"
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End If
If Button1.Text = "0" And Button5.Text = "0" And Button9.Text = "0" Then
Label2.Text = "0 wins"
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End If
If Button3.Text = "0" And Button5.Text = "0" And Button7.Text = "0" Then
Label2.Text = "0 wins"
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End If
End Sub

Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
Button1.Enabled = True
Button2.Enabled = True
Button3.Enabled = True
Button4.Enabled = True
Button5.Enabled = True
Button6.Enabled = True
Button7.Enabled = True
Button8.Enabled = True
Button9.Enabled = True
Label2.Text = ""
Button1.Text = ""
Button2.Text = ""
Button3.Text = ""
Button4.Text = ""
Button5.Text = ""
Button6.Text = ""
Button7.Text = ""
Button8.Text = ""
Button9.Text = ""
End Sub
End Class

Soll ein Tic Tac toe werden ;)
 
Gibt denn die Errorlist keine Fehler aus.
http://msdn.microsoft.com/en-us/library/33df3b7a(v=vs.80).aspx

Btw, du solltest den Code in die entsprechenden Tags setzen.
[*code]
[*/code] (ohne die *)

Noch ein kleiner Tipp wenn du ein paar Teile deines codes in subs auslagerst sparst du dir eine Menge an Code, und brauchst nicht immer wieder die Buttons/Labels ansprechen. Bessere Name für deine Steuerelemente wären vielleicht auch eine gute Idee.

Für uns ist Button1, Button2, Button3 nicht besonders leicht zum lesen.

Edit:
Noch eine Anmerkung, von der Qualität des Codes nehme ich stark an du bist bei deinen ersten Versuchen in der VB.NET Programmierung, daher würde ich dir empfehlen doch gleich mit VS 2012 oder sogar mit VS 2013 Preview (VS = Visual Studio) zu arbeiten.
Macht eher wenig Sinn als Programmieranfänger mit einer alten IDE anzufangen, da doch gleich aufs neuste aufbauen.
 
Zuletzt bearbeitet:
Okay, ich würde sagen, du fängst erstmal komplett von Neu an, nachdem du ein entsprechendes Tutorial zu VB.Net durchgearbeitet hast.
Das macht sonst keinen Sinn.
 
Ich nehme an die Fehlermeldung ergibt sich aus der Tatsache das er keinen "letzten erfolgreichen Build" finden kann.

Das kann mehrere Gründe haben.
1.) Das Projekt hat noch NIE einen erfolgreichen build
2.) Durch ein clean wurde der build gelöscht

Um es zu beheben musst du die Fehler korrigieren die in deinem Projekt sind, ich kann dir anbieten das Projekt per ZIP hochzuladen und ich schaue es mir an.
 
Zurück
Oben