As i posted last night, i was making a game of tic-tac-toe.
Im pretty much done, i just dont know how to add a win check. Once i get that ill make it winsock for online fun ; )..Heres the code:

VB Code:
  1. Option Explicit
  2. Dim x, y As Integer
  3. Dim teamname, compname As String
  4.  
  5. Private Sub Form_Load()
  6.     Call Restart1
  7. End Sub
  8.  
  9. Private Sub Restart_Click()
  10.     Call Restart1
  11. End Sub
  12.  
  13. Private Sub xolbl_Click(Index As Integer)
  14. If Len(xolbl(Index).Caption) > 0 Then Exit Sub
  15.   Select Case teamname
  16.         Case "x"
  17.              xolbl(Index).Caption = "x"
  18.         Case "o"
  19.              xolbl(Index).Caption = "o"
  20.     End Select
  21.     Call rndfunc
  22.     Call addblock
  23. End Sub
  24.  
  25. Private Sub rndfunc()
  26.         y = Int((8 * Rnd) + 1)
  27.       '  MsgBox y
  28. End Sub
  29.  
  30. Private Sub changeteams()
  31.     Select Case teamname
  32.         Case "x"
  33.             compname = "o"
  34.         Case "o"
  35.             compname = "x"
  36.     End Select
  37.     If Len(xolbl(y)) > 0 Then
  38.             Call rndfunc
  39.             Call addblock
  40.             End If
  41. End Sub
  42.  
  43. Private Sub addblock()
  44. On Error GoTo errhndlr
  45.         If Len(xolbl(y)) > 0 Then
  46.             Call rndfunc
  47.             Call changeteams
  48.         Else
  49.             Call changeteams
  50.             xolbl(y) = compname
  51.         End If
  52.         xolbl(y) = compname
  53.         Call Checkforwin
  54. errhndlr:
  55.     If Len(Err.Description) > 0 Then
  56.         MsgBox Err.Number & Err.Description & " Source " & Err.Source
  57.     End If
  58. End Sub
  59.  
  60. Private Sub Checkforwin()
  61.    
  62. End Sub
  63.  
  64. Private Sub Restart1()
  65. Dim i As Integer
  66. Randomize
  67.     x = Int((2 * Rnd) + 1)
  68.     If x = 2 Then
  69.         teamname = "x"
  70.     Else
  71.         teamname = "o"
  72.     End If
  73.     For i = 0 To xolbl.UBound
  74.     xolbl(i).Caption = vbNullString
  75.  Next i
  76.  You.Caption = "You = " & teamname
  77. End Sub

How do i check for three in a row?