MessageBox.Show appear over Remote Desktop Connect

2020-02-16 04:05发布

问题:

So I am building a program at the minute where I need a MessageBox to show over an RDC (Remote Desktop Connection) but I can't seem to manage it. Any tips?

Here is the code I am currently trying if it helps.

public void button2_Click(object sender, EventArgs e)
{
    MessageBox.Show(this, "Hello");
}

Cheers

Tom

回答1:

Try this it will show your MessageBox at the top of every window currently open.

MessageBox.Show(this,
                "Your text",
                "Settings Needed",
                MessageBoxButtons.YesNo,
                MessageBoxIcon.Question
                MessageBoxDefaultButton.Button1,  // specify "Yes" as the default
                (MessageBoxOptions)0x40000);