在winform中让MessageBox.Show显示的窗口不显示在任务栏中:
第一个参数很明显是你要显示的内容   类型是string
语法
Visual Basic(声明)
Public Shared Function Show ( _
text As String, _
caption As String, _
buttons As MessageBoxButtons, _
icon As MessageBoxIcon, _
defaultButton As MessageBoxDefaultButton, _
options As MessageBoxOptions, _
helpFilePath As String, _
navigator As HelpNavigator, _
param As Object _
) As DialogResult
 
Visual Basic(用法)
Dim text As String
Dim caption As String
Dim buttons As MessageBoxButtons
Dim icon As MessageBoxIcon
Dim defaultButton As MessageBoxDefaultButton
Dim options As MessageBoxOptions
Dim helpFilePath As String
Dim navigator As HelpNavigator
Dim param As Object
Dim returnValue As DialogResultreturnValue = MessageBox.Show(text, caption, _
buttons, icon, defaultButton, options, _
helpFilePath, navigator, param)
 
C#
public static DialogResult Show(
string text,
string caption,
MessageBoxButtons buttons,
MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton,
MessageBoxOptions options,
string helpFilePath,
HelpNavigator navigator,
Object param
)
 
Visual C++
public:
static DialogResult Show(
String^ text,
String^ caption,
MessageBoxButtons buttons,
MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton,
MessageBoxOptions options,
String^ helpFilePath,
HelpNavigator navigator,
Object^ param
)
 
J#
public static DialogResult Show(
String text,
String caption,
MessageBoxButtons buttons,
MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton,
MessageBoxOptions options,
String helpFilePath,
HelpNavigator navigator,
Object param
)
 
JScript
public static function Show(
text : String,
caption : String,
buttons : MessageBoxButtons,
icon : MessageBoxIcon,
defaultButton : MessageBoxDefaultButton,
options : MessageBoxOptions,
helpFilePath : String,
navigator : HelpNavigator,
param : Object
) : DialogResult
 参数
text
类型:System..::.String要在消息框中显示的文本。caption
类型:System..::.String要在消息框的标题栏中显示的文本。buttons
类型:System.Windows.Forms..::.MessageBoxButtonsMessageBoxButtons 值之一,可指定在消息框中显示哪些按钮。icon
类型:System.Windows.Forms..::.MessageBoxIconMessageBoxIcon 值之一,它指定在消息框中显示哪个图标。defaultButton
类型:System.Windows.Forms..::.MessageBoxDefaultButtonMessageBoxDefaultButton 值之一,可指定消息框中的默认按钮。options
类型:System.Windows.Forms..::.MessageBoxOptionsMessageBoxOptions 值之一,可指定将对消息框使用哪些显示和关联选项。若要使用默认值,请传入 0。helpFilePath
类型:System..::.String用户单击“帮助”按钮时显示的“帮助”文件的路径和名称。navigator
类型:System.Windows.Forms..::.HelpNavigatorHelpNavigator 值之一。param
类型:System..::.Object用户单击“帮助”按钮时显示的帮助主题的数值 ID。返回值
类型:System.Windows.Forms..::.DialogResultDialogResult 值之一。

关于MssageBox.Show(this,"test")这个this主要是指运行MessageBox()的“母程序”对象
也就是说,如果你定义了一个窗口程序,然后窗口程序中有唤出MessageBox时,当中的this就是这个窗口程序。
比如:我定义的程序是program1
当中有MessageBox.Show(this.button1, "我还在任务栏中吗?", "logo", MessageBoxButtons.OK);
那这个“this.button1”指的就是这个program1窗口上的ID为“this.button1”的按钮。
也可以指当前窗口如MessageBox.Show(this, "我还在任务栏中吗?", "logo", MessageBoxButtons.OK);
这样就可以让MessageBox.Show提示框不出现在任务栏了。

另:MessageBox.Show(this,"提示:","显示在最上层");

如果我们想要MessageBox展现模态框的效果,那么this就是当前窗体,例如当前窗体对象为form1,

那么就是MessageBox.Show(form1,"提示:","显示在窗体form1最上层的模态提示框");

C#中MessageBox.Show问题(让提示窗口不显示在任务栏中)的更多相关文章

  1. Delphi中,除了应用程序主窗口会显示在任务栏上,其它窗口默认都不会显示在任务栏.

    Delphi中,除了应用程序主窗口会显示在任务栏上,其它窗口默认都不会显示在任务栏. Delphi中,除了应用程序主窗口会显示在任务栏上,其它窗口默认都不会显示在任务栏.没有MS开发环境中的ShowI ...

  2. 怎样让窗口不显示在任务栏和ALT+TAB中(隐藏窗口再嵌套,几乎是万能的办法)

    之前想弄个像QQ旋风那样的悬浮窗口,就研究了下怎么让窗口不显示在任务栏中,方法其实很简单就是将窗口的扩张属性设置成WS_EX_TOOLWINDOW,MSDN中对该属性有详细介绍,代码如下: ::Set ...

  3. [转载]C#中MessageBox.Show用法以及VB.NET中MsgBox用法

    一.C#中MessageBox.Show用法 MessageBox.Show (String) 显示具有指定文本的消息框. 由 .NET Compact Framework 支持. MessageBo ...

  4. winform中messageBox七个参数的使用(转载)

    private void button1_Click(object sender, EventArgs e) { MessageBox.Show(" 1 个参数 ”); } private ...

  5. C# WinForm 中 MessageBox的使用详解

    1.C# WinForm 中 MessageBox的使用详解:http://www.cnblogs.com/bq-blog/archive/2012/07/27/2611810.html

  6. 转:VC中MessageBox的常见用法

    一.关于MessageBox       消息框是个很常用的控件,属性比较多,本文列出了它的一些常用方法,及指出了它的一些应用场合.       1.MessageBox("这是一个最简单的 ...

  7. JAVA中MESSAGEBOX,静态类直接引用

    原文:JAVA中MESSAGEBOX,静态类直接引用 package cisdi.mes.wrm.mcode.serviceImpl; import javax.persistence.Entity; ...

  8. VC中MessageBox的常见用法

    一.关于MessageBox       消息框是个很常用的控件,属性比较多,本文列出了它的一些常用方法,及指出了它的一些应用场合.       1.MessageBox("这是一个最简单的 ...

  9. DELPHI中MessageBox的用法

    MessageBox对话框 输入控件的   ImeName属性把输入法去掉就默认为英文输入了 MessageBox对话框是比较常用的一个信息对话框,其不仅能够定义显示的信息内容.信息提示图标,而且可以 ...

随机推荐

  1. el表达式与<c:foreach>标签的联合各种使用方法记录

    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%><%@ tagl ...

  2. 12-Python操作json

    1.概述 Python操作json文件在测试中会经常用到,那么python怎么操作json文件呢,今天就来简单了解一下.Python中提供了dumps.dump.loads.load,用于字符串 和 ...

  3. StringBuilder and StringBuffer

    StringBuilder sb = new StringBuilder(); /* 无参构造器 */ sb = new StringBuilder("abc"); /* 字符串构 ...

  4. C语言+嵌入式SQL+DB2开发经验总结

    1.使用DB2工具将SQC文件预编译成C文件和bnd文件. 命令: db2 prep ***.sqc version * package using * bindfile BLOCKING ALL I ...

  5. 移动端rem计算

    教你如何用 lib-flexible 实现移动端H5页面适配 2017年07月22日 16:01:24 Pwcong 阅读数:18872    版权声明:本文为博主原创文章,未经博主允许不得转载. h ...

  6. [转载]你所不了解的DevOps

    DevOps开发运维训练营 一旦建立了创新的文化,即使那些并非科学家或者工程师的人——诗人.演员.记者——也能以团体的形式,接受科学文化的意义.他们信奉创新文化的概念.他们以促进这种文化的方式投票.他 ...

  7. 一次非常有趣的 SQL 优化经历

    阅读本文大概需要 6 分钟. 前言 在网上刷到一篇数据库优化的文章,自己也来研究一波. 场景 数据库版本:5.7.25 ,运行在虚拟机中. 课程表 #课程表 create table Course( ...

  8. 第68节:Java中的MYSQL运用从小白到大牛

    第68节:Java中的MYSQL运用从小白到大牛 前言 学习java必备要求,学会运用!!! 常见关系化数据库 BootStrap是轻量级开发响应式页面的框架,全局css组件,js插件.栅格系统是将页 ...

  9. 项目笔记:2017年(SSM架构)

    一.第一部分 前后端分离后的测试工具的使用(Postman): svn先更新再提交,冲突就把自己占位的地方让出,再提交: maven项目也可以用tomcat直接启动: 在mybatis.xml文件中, ...

  10. core跨域问题

    #region 跨域问题 app.UseCors(builder => builder .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader() ...