Only assignment, call, increment, decrement, and new object expressions can be used as a statement : Messagebox
Posted
by
Nuru Salihu
on Stack Overflow
See other posts from Stack Overflow
or by Nuru Salihu
Published on 2013-11-11T03:24:39Z
Indexed on
2013/11/11
3:53 UTC
Read the original article
Hit count: 187
c#
|messagebox
This what i am trying to achieved
if(this.BeginInvoke((Action)(() => MessageBox.Show("Test", MessageBoxButtons.YesNo) == DialogResult.No)))
The above gives error. I try seperating the delegate to an outside method like
delegate void test(string text);
private void SetTest(string text)
{
if(MessageBox.Show(text,"", MessageBoxButtons.YesNo) == DialogResult.No)
}
But it breach the very reason why i need the delegate. I found out the first works for me but i don't know how to put it in an if/else statement. Pls any help in a better way i can achieve some thing like below would be appreciated.
if(this.BeginInvoke((Action)(() => MessageBox.Show("Test", MessageBoxButtons.YesNo) == DialogResult.No)))
© Stack Overflow or respective owner