本文整理汇总了C#中MessageBoxButtons.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# MessageBoxButtons.Equals方法的具体用法?C# MessageBoxButtons.Equals怎么用?C# MessageBoxButtons.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageBoxButtons
的用法示例。
在下文中一共展示了MessageBoxButtons.Equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowMessageBox
// =================================================================================
// General and "global" functions
// =================================================================================
#region General
// Note about thread guards: The prologue "if(InvokeRequired) {something long}" at a start of a function,
// makes the function safe to call from another thread.
// See http://stackoverflow.com/questions/661561/how-to-update-the-gui-from-another-thread-in-c,
// "MajesticRa"'s answer near the bottom of first page
#region MessageDialogs
// =================================================================================
// Thread safe dialog box:
// (see http://stackoverflow.com/questions/559252/does-messagebox-show-automatically-marshall-to-the-ui-thread )
public DialogResult ShowMessageBox(String message, String header, MessageBoxButtons buttons) {
if (InvokeRequired) {
return (DialogResult)Invoke(new PassStringStringReturnDialogResultDelegate(ShowMessageBox), message, header, buttons);
}
if (buttons.Equals(MessageBoxButtons.OK)) {
return ShowSimpleMessageBox(message);
}
return MessageBox.Show(this, message, header, buttons);
}
示例2: MostrarMsjXtraMessage
//Se utilizara para mostrar mensajes de informacion hasta mensajes SI/NO devolviendo su repuesta
public bool MostrarMsjXtraMessage(string msj, string title, MessageBoxButtons type, MessageBoxIcon icon)
{
bool sino = false;
if (type.Equals(MessageBoxButtons.YesNo))
{
DialogResult result = XtraMessageBox.Show(msj, title, type, icon);
if (DialogResult.Yes == result)
{
sino = true;
}
else if (DialogResult.No == result)
{
sino = false;
}
}
else
{
XtraMessageBox.Show(msj, title, type, icon);
sino = true;
}
return sino;
}