【背景】
C#中想要获得MessageBox的返回值
【解决过程】
1.参考这里知道了对应的用法,即使用一个DialogResult 获得Show所返回的结果,代码如下:
DialogResult yesToInsert = MessageBox.Show("Seems you have already select some content in Windows Live Writer, so insert the string of selected files will overwrite your selected content." + Environment.NewLine + "Are you sure to conntinue to insert ?", "Insert Files", MessageBoxButtons.YesNo); if (yesToInsert == DialogResult.Yes) { doInsert = true; } else { doInsert = false; }
转载请注明:在路上 » 【已解决】C#中如何获得MessageBox的返回值