I am in school and just learning and I am completely stumped on this lesson.

I have determined that I will be using an array

dim playingBoard(2,2) as string - 9 possible places to put an x or an o
dim x as integer
dim o as integer

I have a total of 9 textbox's

textBox1 - textBox9

have a Sub for each textBox

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

I did this so that when an x or an o was typed into the textbox it would get the focus and I could do something with it.

I want to do a private function that checks to see if I have 3 x's or 3 o's in a row based on the placement of the x and o's. So I created a lookForWinner Sub to do the function for me.

ie. if textBox1 and textBox2 and textBox3 have o's in them then messagebox.show("o's win")

Can anyone help me with this? I am just missing something and I just don't understand why I can't get the code to do what I want.


You can find more tutorials about Tic Tac Toe games on Google.
But this is another one, here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.