在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. Activity的task任务栈

    转自http://blog.csdn.net/liuhe688/article/details/6761337 古人學問無遺力,少壯工夫老始成.紙上得來終覺淺,絕知此事要躬行.南宋.陸遊<冬夜讀 ...

  2. #254 Check for Palindromes

    Check for Palindromes 检查回文字符串 如果给定的字符串是回文,返回true,反之,返回false. 如果一个字符串忽略标点符号.大小写和空格,正着读和反着读一模一样,那么这个字符 ...

  3. 2017-12-04 编写Visual Studio Code插件初尝试

    参考官方入门: Your First Visual Studio Code Extension - Hello World 源码在: program-in-chinese/vscode_helloWo ...

  4. 【sql注入教程】SQL注入是什么?我们如何去玩转它

    [sql注入教程]SQL注入是什么?我们如何去玩转它 本文转自:i春秋社区   SQL注入攻击是黑客攻击数据库最常见手段之一.简单讲,SQL注入攻击是黑客利用网站程序漏洞,通过提交精心构造的SQL语句 ...

  5. 1分钟快速制作漂亮的H5本地记事本

    大家好,以前给大家分享过一个五步骤制作精美的HTML5时钟的文章,点击回顾<五步教你制作漂亮精致的HTML时钟>,还有<一分钟教你如何实现唯美的文字描边>:今天给大家分享一个用 ...

  6. JavaScript原生实现观察者模式

    观察者模式又叫做发布订阅模式,它定义了一种一对多的关系,让多个观察者对象同时监听某一个主题对象,这个主题对象的状态发生改变时就会通知所有观察着对象. 它是由两类对象组成,主题和观察者,主题负责发布事件 ...

  7. [Vuejs] svg-sprite-loader实现加载svg自定义组件

    1.安装 svg-sprite-loader npm install svg-sprite-loader -D 或者 npm install svg-sprite-loader --save-dev ...

  8. 生产apollo搭建记录(五)

    1. 生产apollo搭建记录(五) 1.1. 目标   搭建两个环境配置,dev和pro,但目前可用服务器限制,打算mysql用同一个,服务器分生产和测试 1.2. 数据库 建三个库 注意注意:在启 ...

  9. FTP--FileZilla-主动模式和被动模式

    PORT 主动模式: 用户主机一个随机端口连接FTP SERVER的TCP21端口进行协商: 用户主机告诉FTP SERVER,我的XXXX端口已经打开,你可以放心大胆的连过来: 然后FTP SERV ...

  10. ubuntu默认的Python版本号修改

    ubuntu默认的Python是2.7版本的,键入Python3 就可以使用Python3.X版本.下面修改默认的Python版本, 1.删除/usr/bin 下的Python链接 sudo rm / ...