在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. Ubuntu 16——安装——ns2.35和nam

    Ubuntu 16.04 安装ns2.35+nam 总结出以下安装步骤 1: 更新源 sudo apt-get update #更新源列表 sudo apt-get upgrade #更新已经安装的包 ...

  2. 先序遍历DOM树的5种方法

    DOM树由文档中的所有节点(元素节点.文本节点.注释节点等)所构成的一个树结构,DOM树的解析和构建是浏览器要实现的关键功能.既然DOM树是一个树结构,那么我们就可以使用遍历树结构的相关方法来对DOM ...

  3. Transaction rolled back because it has been marked as rollback-only

    出现这种错误的原因 1.接口A 调用了接口B 2.接口B报异常了,没有在B里面进行try catch捕获 3.接口A对 接口B进行了try catch捕获 因为接口B报异常 会把当前事物A接口的事物( ...

  4. JDK设计模式之——策略模式(Comparable和Comparator接口)

    策略模式:其实就是java的多态...父类引用指向子类对象. 使用策略模式,改善排序算法上文中需要排序的是一个数组 让他可以对任何类型的数组进行排序 1.利用 接口 Comparable<T&g ...

  5. Python学习笔记【第十五篇】:Python网络编程三ftp案例练习--断点续传

    开发一个支持多用户在线的FTP程序-------------------主要是学习思路 实现功能点 1:用户登陆验证(用户名.密码) 2:实现多用户登陆 3:实现简单的cmd命令操作 4:文件的上传( ...

  6. C#退出窗体的总结方法

    一.关闭窗体 在c#中退出WinForm程序包括有很多方法,如:this.Close(); Application.Exit();Application.ExitThread(); System.En ...

  7. Mybatis优缺点

    优点:SQL写在XML中,便于统一管理和优化 提供映射标签,支持对象和数据库的orm字段关系映射 可以对SQL进行优化      缺点: SQL工作量大 mybagtis移植姓不好 不支持级联

  8. numpy中的norm用法

    np.linalg.norm() computes the norm of a NumPy array according to an order, ord, which specifies the ...

  9. VS Code 快捷键大全

    前言 VSCode的快捷键继承了一些IDE风格,有VS的身影,也有Emacs的身影..简言之,内置快捷键玩熟了,效率提高不是一点两点. VsCode 快捷键有五种组合方式(科普) 通用快捷键 基础编辑 ...

  10. Java核心技术及面试指南 键值对方面的面试题总结以及答案

    3.3.5.1如何遍历HashMap对象?尤其请说明通过Iterator遍历HashMap对象的方法. 建议用这种方式: Set<Entry<String,String>>en ...