Example #1
0
 /// <summary>
 /// 显示一个信息盒子, 阻断当前线程
 /// </summary>
 /// <param name="handle">载体窗口句柄</param>
 /// <param name="text">需要显示的Text主体内容</param>
 /// <param name="caption">标题</param>
 /// <param name="buttons">窗体提供的按钮选项,用户选择结果将返回</param>
 /// <param name="icon">信息盒子的提示图标(信息类型)</param>
 /// <param name="defaultButton">默认选择的按钮(注意有无第四项)</param>
 /// <param name="options">信息盒子选项</param>
 /// <param name="displayHelpButton">是否显示帮助按钮</param>
 /// <returns>窗体返回结果(用户点击的按钮)</returns>
 public static DialogResult ShowTopMost(IntPtr handle, string text, string caption, DefaultButtons buttons, DefaultICON icon, DefaultSelectedButton defaultButton, MessageBoxOptions options, bool displayHelpButton)
 {
     return((DialogResult)User32.MessageBox(handle, text, caption, GetCMD((LNG)buttons, (LNG)icon, (LNG)defaultButton, (LNG)options, MB_TOPMOST, displayHelpButton ? MB_HELP : 0)));
 }
Example #2
0
 /// <summary>
 /// 显示一个信息盒子, 阻断当前线程
 /// </summary>
 /// <param name="handle">载体窗口句柄</param>
 /// <param name="text">需要显示的Text主体内容</param>
 /// <param name="caption">标题</param>
 /// <param name="buttons">窗体提供的按钮选项,用户选择结果将返回</param>
 /// <param name="icon">信息盒子的提示图标(信息类型)</param>
 /// <param name="defaultButton">默认选择的按钮(注意有无第四项)</param>
 /// <param name="options">信息盒子选项</param>
 /// <returns>窗体返回结果(用户点击的按钮)</returns>
 public static DialogResult ShowTopMost(IntPtr handle, string text, string caption, DefaultButtons buttons, DefaultICON icon, DefaultSelectedButton defaultButton, MessageBoxOptions options)
 {
     return(ShowTopMost(handle, text, caption, buttons, icon, defaultButton, options, false));
 }
Example #3
0
 /// <summary>
 /// 显示一个信息盒子, 阻断当前线程
 /// </summary>
 /// <param name="text">需要显示的Text主体内容</param>
 /// <param name="caption">标题</param>
 /// <param name="buttons">窗体提供的按钮选项,用户选择结果将返回</param>
 /// <param name="icon">信息盒子的提示图标(信息类型)</param>
 /// <param name="defaultButton">默认选择的按钮(注意有无第四项)</param>
 /// <returns>窗体返回结果(用户点击的按钮)</returns>
 public static DialogResult ShowTopMost(string text, string caption, DefaultButtons buttons, DefaultICON icon, DefaultSelectedButton defaultButton)
 {
     return(ShowTopMost(text, caption, buttons, icon, defaultButton, 0));
 }
Example #4
0
 /// <summary>
 /// 显示一个信息盒子, 阻断当前线程
 /// </summary>
 /// <param name="handle">载体窗口句柄</param>
 /// <param name="text">需要显示的Text主体内容</param>
 /// <param name="caption">标题</param>
 /// <param name="buttons">窗体提供的按钮选项,用户选择结果将返回</param>
 /// <param name="icon">信息盒子的提示图标(信息类型)</param>
 /// <param name="defaultButton">默认选择的按钮(注意有无第四项)</param>
 /// <returns>窗体返回结果(用户点击的按钮)</returns>
 public static DialogResult Show(IntPtr handle, string text, string caption, DefaultButtons buttons, DefaultICON icon, DefaultSelectedButton defaultButton)
 {
     return(Show(handle, text, caption, buttons, icon, defaultButton, 0));
 }
Example #5
0
 /// <summary>
 /// 显示一个信息盒子, 阻断当前线程
 /// </summary>
 /// <param name="text">需要显示的Text主体内容</param>
 /// <param name="caption">标题</param>
 /// <param name="buttons">窗体提供的按钮选项,用户选择结果将返回</param>
 /// <param name="icon">信息盒子的提示图标(信息类型)</param>
 /// <param name="defaultButton">默认选择的按钮(注意有无第四项)</param>
 /// <param name="options">信息盒子选项</param>
 /// <param name="displayHelpButton">是否显示帮助按钮</param>
 /// <returns>窗体返回结果(用户点击的按钮)</returns>
 public static DialogResult Show(string text, string caption, DefaultButtons buttons, DefaultICON icon, DefaultSelectedButton defaultButton, MessageBoxOptions options, bool displayHelpButton)
 {
     return((DialogResult)User32.MessageBox(User32.GetForegroundWindow(), text, caption, GetCMD((LNG)buttons, (LNG)icon, (LNG)defaultButton, (LNG)options, displayHelpButton ? MB_HELP : 0)));
 }