Question: So, I'm trying to create a function that will take in a list of lists, each consisting of 9 integers numbered 1 through 9, and return a Boolean if it is a valid solution to for a Sudoku. Right now, I've managed to solve part of the problem with checking for rows and columns, but I am stuck on the implementation of checking the three by three boxes. Here's my code so far.

```
alist = [1,2,3,4,5,6,7,8,9]

def checkSudoku(grid):
    a = grid
    b = grid
    c = grid
    d = False
    e = False
    f = False
    newlist = []
    for i in a:
        i.sort()
        if i == alist:
            d = True
        else:
            d = False
            break
    for j in range(9):
        for k in b:
            newlist.append(k)

        newlist.sort()
        if i == alist:
            e = True
            newlist = []
        else:
            e = False
            break

    if d == True and e == True:
        return True
    else:
        return False

```

Basically, My was to test all three factors necessary for it to be true, then return True if all three are True, else return false. Any help?

Answer: 
How about something like this?

```
public bool validate(string text)
{
     return (text == num.ToString());
}

```

And calling it in your code like this. You should try to make code as reusable as possible. Which means that references to specific instances of controls on a Form is not always the best design. 

```
if (at.validate(textBox1.Text))
{
     ListBox.Items.Add("Valid");
}

```
Sorry I can't comment on your post, I don't have enough reputation.

I've had similar trouble once before getting a form to access a string from another form.

In my case I just had to make the string static. Try doing the same with your textbox.

```
public static TextBox textBox1;
public Form1()

```