Hello, guys. I need your help. :o3
I want to create a MessageBox which may "communicate" with form. Actually, i need to communicate with form. It's a kind of backtraking and I want to display in more ways the solution.

void afisare()
{
    int dame = int.Parse(Dame.Text);
    afisari++;
    for (int i = 0; i < dame; i++)
        for (int j = 0; j < dame; j++)
                        if (S[i] == j)
                            M[i, j].BackgroundImage = dama;
//bla bla bla
//end here comes the MessageBox part
//.
//.
//.
//.

If i don't make that messagebox the program will display all ways. But I want in same time to make smt in Form.
Does anyone have any idea?

use a Yes/No messagebox to interact with form

            DialogResult MSG = MessageBox.Show("Subtitle", "Title", MessageBoxButtons.YesNo);
            if (MSG == DialogResult.Yes)
            {
                //code
            }
            else if (MSG == DialogResult.No)
            {
                //code
            }

This is a way to make a MessageBox
And this is another old "snippet" of mine where a dialogbox and a form communicate with each other.

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.