VB Code:
  1. Public Function compturn()
  2.  
  3. '
  4.  
  5. Dim compmove As Integer
  6. Dim mask As Object
  7. mask = Format(compmove, "btn#")
  8. compmove = CStr(Int(Rnd() * 10))
  9. Label4.Text = mask
  10. mask.Text = "O"
  11. mask.Enabled = False
  12.  
  13. 'Make sure that a button that is already clicked
  14. 'by either the user or the computer is not clicked again
  15.  
  16. If mask.Enabled = False And compmove = 1 Then
  17. compmove += 1
  18.  
  19. If compmove = 10 Then
  20. compmove = 1
  21. End If
  22. End If

So I have my form settup with 9 buttons named btn1, btn2...etc
I'm trying to make it so that if you click a button it will go X, then the computer will randomly select a spot, the problem lies in this line "mask.Text = "O" " or at least that is where the error is given, any help or suggestions would be greatly appreciated, I can try to explain more of what i'm trying to do but I need specific questions otherwise i dont know what to tell you.. thanks in advance