Kirjautuminen

Haku

Tehtävät

Keskustelu: Koodit: VB6: Ristinolla visuabasicille

Gary534 [08.05.2005 23:04:13]

#

Kaikki on varmaan jo jonkin aikaa toivonut ristinollaa tänne. Mutta nyt kaikki saa sen ristinollan minkä on toivonut se ei käytä mitään huippu erikoista koodia vaan ihan tavallista kaikki osaa tehdä ristinollan jos osaa edes jonkin verran visualbasicin koodia. Jos haluat kopioda tämän suoraan sinulla pitää olla picturebox:01, 02, 03, 04, 05, 06, 07, 08, 09 sitten image:1, 2, 3, 4, 5, 6, 7, 8, 9
frame:1, 2 label:1, 2 commandbutton: 1 ja timer:3

Dim sp1 As Boolean
Dim sp2 As Boolean
Dim p1p As Integer
Dim p2p As Integer

Function lösch()

O1.Visible = False
O2.Visible = False
O3.Visible = False
O4.Visible = False
O5.Visible = False
O6.Visible = False
O7.Visible = False
O8.Visible = False
O9.Visible = False

X1.Visible = False
X2.Visible = False
X3.Visible = False
X4.Visible = False
X5.Visible = False
X6.Visible = False
X7.Visible = False
X8.Visible = False
X9.Visible = False
End Function

Private Sub Command1_Click()
End
End Sub

Private Sub Image1_Click()

If sp1 = True And O1.Visible = False Then
    X1.Visible = True
    sp2 = True
    sp1 = False
    Exit Sub
End If

If sp2 = True And X1.Visible = False Then
    O1.Visible = True
    sp1 = True
    sp2 = False
    Exit Sub
End If

End Sub

Private Sub Form_Load()

sp1 = True
sp2 = False


X1.Visible = False
X2.Visible = False
X3.Visible = False
X4.Visible = False
X5.Visible = False
X6.Visible = False
X7.Visible = False
X8.Visible = False
X9.Visible = False

O1.Visible = False
O2.Visible = False
O3.Visible = False
O4.Visible = False
O5.Visible = False
O6.Visible = False
O7.Visible = False
O8.Visible = False
O9.Visible = False
End Sub
Private Sub Image2_Click()


If sp1 = True And O2.Visible = False Then
    X2.Visible = True
    sp2 = True
    sp1 = False
    Exit Sub
End If

If sp2 = True And X2.Visible = False Then
    O2.Visible = True
    sp1 = True
    sp2 = False
    Exit Sub
End If

End Sub

Private Sub Image3_Click()

If sp1 = True And O3.Visible = False Then
    X3.Visible = True
    sp2 = True
    sp1 = False
    Exit Sub
End If

If sp2 = True And X3.Visible = False Then
    O3.Visible = True
    sp1 = True
    sp2 = False
    Exit Sub
End If

End Sub

Private Sub Image4_Click()

If sp1 = True And O4.Visible = False Then
    X4.Visible = True
    sp2 = True
    sp1 = False
    Exit Sub
End If

If sp2 = True And X4.Visible = False Then
    O4.Visible = True
    sp1 = True
    sp2 = False
    Exit Sub
End If

End Sub
Private Sub Image5_Click()

If sp1 = True And O5.Visible = False Then
    X5.Visible = True
    sp2 = True
    sp1 = False
    Exit Sub
End If

If sp2 = True And X5.Visible = False Then
    O5.Visible = True
    sp1 = True
    sp2 = False
    Exit Sub
End If

End Sub

Private Sub Image6_Click()
If sp1 = True And O6.Visible = False Then
    X6.Visible = True
    sp2 = True
    sp1 = False
    Exit Sub
End If

If sp2 = True And X6.Visible = False Then
    O6.Visible = True
    sp1 = True
    sp2 = False
    Exit Sub
End If

End Sub

Private Sub Image7_Click()
If sp1 = True And O7.Visible = False Then
    X7.Visible = True
    sp2 = True
    sp1 = False
    Exit Sub
End If

If sp2 = True And X7.Visible = False Then
    O7.Visible = True
    sp1 = True
    sp2 = False
    Exit Sub
End If

End Sub

Private Sub Image8_Click()
If sp1 = True And O8.Visible = False Then
    X8.Visible = True
    sp2 = True
    sp1 = False
    Exit Sub
End If

If sp2 = True And X8.Visible = False Then
    O8.Visible = True
    sp1 = True
    sp2 = False
    Exit Sub
End If

End Sub

Private Sub Image9_Click()
If sp1 = True And O9.Visible = False Then
    X9.Visible = True
    sp2 = True
    sp1 = False
    Exit Sub
End If

If sp2 = True And X9.Visible = False Then
    O9.Visible = True
    sp1 = True
    sp2 = False
    Exit Sub
End If

End Sub

Private Sub O5_Click()

End Sub

Private Sub O6_Click()

End Sub
Private Sub Timer1_Timer()
If sp1 = True Then Form1.MousePointer = 2
If sp2 = True Then Form1.MousePointer = 12
End Sub

Private Sub Timer2_Timer()

If X1.Visible = True And X2.Visible = True And X3.Visible = True Then
    MsgBox "Pelaaja X voittaa", vbOKOnly, "Loppu"
    Timer2.Enabled = False
    lösch
    p1p = p1p + 1
    Timer2.Enabled = True
End If

If X1.Visible = True And X4.Visible = True And X7.Visible = True Then
    MsgBox "Pelaaja X voittaa", vbOKOnly, "Loppu"
    Timer2.Enabled = False
    lösch
    p1p = p1p + 1
    Timer2.Enabled = True
End If

If X1.Visible = True And X5.Visible = True And X9.Visible = True Then
    MsgBox "Pelaaja X voittaa", vbOKOnly, "Loppu"
    Timer2.Enabled = False
    lösch
    p1p = p1p + 1
    Timer2.Enabled = True
End If

If X2.Visible = True And X5.Visible = True And X8.Visible = True Then
    MsgBox "Pelaaja X voittaa", vbOKOnly, "Loppu"
    Timer2.Enabled = False
    lösch
    p1p = p1p + 1
    Timer2.Enabled = True
End If

If X3.Visible = True And X6.Visible = True And X9.Visible = True Then
    MsgBox "Pelaaja X voittaa", vbOKOnly, "Loppu"
    Timer2.Enabled = False
    lösch
    p1p = p1p + 1
    Timer2.Enabled = True
End If

If X3.Visible = True And X5.Visible = True And X7.Visible = True Then
    MsgBox "Pelaaja X voittaa", vbOKOnly, "Loppu"
    Timer2.Enabled = False
    lösch
    p1p = p1p + 1
    Timer2.Enabled = True
End If

If X4.Visible = True And X5.Visible = True And X6.Visible = True Then
    MsgBox "Pelaaja X voittaa", vbOKOnly, "Loppu"
    Timer2.Enabled = False
    lösch
    p1p = p1p + 1
    Timer2.Enabled = True
End If

If X7.Visible = True And X8.Visible = True And X9.Visible = True Then
    MsgBox "Pelaaja X voittaa", vbOKOnly, "Loppu"
    Timer2.Enabled = False
    lösch
    p1p = p1p + 1
    Timer2.Enabled = True
End If


If O1.Visible = True And O2.Visible = True And O3.Visible = True Then
    MsgBox "Pelaaja O voittaa", vbOKOnly, "Loppu"
    Timer2.Enabled = False
    lösch
    p2p = p2p + 1
    Timer2.Enabled = True
End If

If O1.Visible = True And O4.Visible = True And O7.Visible = True Then
    MsgBox "Pelaaja O voittaa", vbOKOnly, "Loppu"
    Timer2.Enabled = False
    lösch
    p2p = p2p + 1
    Timer2.Enabled = True
End If

If O1.Visible = True And O5.Visible = True And O9.Visible = True Then
    MsgBox "Pelaaja O voittaa", vbOKOnly, "Loppu"
    Timer2.Enabled = False
    lösch
    p2p = p2p + 1
    Timer2.Enabled = True
End If

If O2.Visible = True And O5.Visible = True And O8.Visible = True Then
    MsgBox "Pelaaja O voittaa", vbOKOnly, "Loppu"
    Timer2.Enabled = False
    lösch
    p2p = p2p + 1
    Timer2.Enabled = True
End If

If O3.Visible = True And O6.Visible = True And O9.Visible = True Then
    MsgBox "Pelaaja O voittaa", vbOKOnly, "The End"
    Timer2.Enabled = False
    lösch
    p2p = p2p + 1
    Timer2.Enabled = True
End If

If O3.Visible = True And O5.Visible = True And O7.Visible = True Then
    MsgBox "Pelaaja O voittaa", vbOKOnly, "The End"
    Timer2.Enabled = False
    lösch
    p2p = p2p + 1
    Timer2.Enabled = True
End If

If O4.Visible = True And O5.Visible = True And O6.Visible = True Then
    MsgBox "Pelaaja O voittaa", vbOKOnly, "Loppu"
    Timer2.Enabled = False
    lösch
    p2p = p2p + 1
    Timer2.Enabled = True
End If

If O7.Visible = True And O8.Visible = True And O9.Visible = True Then
    MsgBox "Pelaaja O voittaa", vbOKOnly, "Loppu"
    Timer2.Enabled = False
    lösch
    p2p = p2p + 1
    Timer2.Enabled = True
End If

End Sub

Private Sub Timer3_Timer()

Label3.Caption = p1p
Label4.Caption = p2p
End Sub

Gary534 [08.05.2005 23:05:29]

#

Jokainen saa antaa sitten mielipiteensä jos kiinnostaa kiitos.

str4nd [09.05.2005 18:33:51]

#

Hieno, mutta propleema on vaan -- ei toimi.

Blaze [17.05.2005 14:24:55]

#

Control arrayt on kova sana.

Puhveli [22.05.2005 15:57:01]

#

lainaus:

Control arrayt on kova sana.

Näköjään ;D

Vastaus

Aihe on jo aika vanha, joten et voi enää vastata siihen.

Tietoa sivustosta