For school, I have to create a tic tac toe program but I have found checking for a win seems to be longer than is probably needed. I used the tag property to keep track of who clicked on the square and to make sure that u can't click on one that has already been clicked.

VB Code:
  1. If Index = 0 Then
  2.     If lblBox(0).Tag = "1" Then
  3.         If lblBox(3).Tag = "1" And lblBox(6).Tag = "1" Then MsgBox "Player 1 wins", vbOKOnly, "Winner!"
  4.     ElseIf lblBox(0).Tag = "2" Then
  5.         If lblBox(3).Tag = "2" And lblBox(6).Tag = "2" Then MsgBox "Player 2 Wins", vbOKOnly, "Winner!"
  6.     ElseIf lblBox(0).Tag = "1" Then
  7.         If lblBox(1).Tag = "1" And lblBox(2).Tag = "1" Then MsgBox "Player 1 wins", vbOKOnly, "Winner!"
  8.     ElseIf lblBox(0).Tag = "2" Then
  9.         If lblBox(1).Tag = "2" And lblBox(2).Tag = "2" Then MsgBox "Player 2 Wins", vbOKOnly, "Winner!"
  10.     ElseIf lblBox(0).Tag = "1" Then
  11.         If lblBox(4).Tag = "1" And lblBox(8).Tag = "1" Then MsgBox "Player 1 wins", vbOKOnly, "Winner!"
  12.     ElseIf lblBox(0).Tag = "2" Then
  13.         If lblBox(4).Tag = "2" And lblBox(8).Tag = "2" Then MsgBox "Player 2 Wins", vbOKOnly, "Winner!"
  14.     End If
  15. End If

This is the code I am using now and all that only checks for across the top, down the left, and diangonal left top to right bottom. If theres an easier way to do this could you please help. Thanks.