在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. Android中监控home键

    一.需求 在应用开发过程中,启动服务开启线程锁等待服务返回解锁,为了避免点击home键使线程锁卡死的bug,需要监控home键,解锁线程. 二.实现 在应用时,需要register和unregiste ...

  2. Reids学习2 -- 使用Jedis操作Redis

    1. 如何获取Jedis 获取Jar包可以通过Maven库获取:http://mvnrepository.com/artifact/redis.clients/jedis 或者可以通过Maven配置: ...

  3. 剑指offer面试题26:复杂链表的复制

    题目:请实现一个函数,复制一个复杂链表. 在复杂链表中,每个结点除了有一个next指针指向下一个结点外,还有一个sibling指针指向链表中的任意结点或者nulL 直观解法: 1.遍历链表,复制链表节 ...

  4. [翻译][架构设计]The Clean Architecture

    原文地址:The Clean Architecture The Clean Architecture Over the last several years we've seen a whole ra ...

  5. Javascript高级编程学习笔记(55)—— DOM2和DOM3(7)操作范围

    操作范围中的内容 在创建范围时,内部会为这个范围创建一个文档片段 范围所属的全部节点都会被添加到这个片段中 虽然选取范围可以不是完整的.良好的DOM结构 但是在这个为范围创建的文档片段中,会自己完缺少 ...

  6. Java学习笔记二:数据类型II

    GitHub代码练习地址:https://github.com/Neo-ML/JavaPractice/blob/master/Intpractice3.java 一  Java中的数据类型 Java ...

  7. NopCommerce用.net core重写ef

    最近看了NopCommerce源码,用core学习着写了一个项目,修改的地方记录下.项目地址 NopCommerce框架出来好久了.18年的第一季度 懒加载出来后也会全部移动到.net core.那么 ...

  8. Lock wait timeout exceeded

    MySQL事务锁问题-Lock wait timeout exceeded问题: 一次ios在请求接口响应时间超长,耗时几十秒才返回错误提示,后台日志中出现Lock wait timeout exce ...

  9. Anaconda下载地址

    Anaconda installer archive:地址1: https://repo.continuum.io/archive/地址2:https://mirrors.tuna.tsinghua. ...

  10. 【MML】华为MML AAA接口联调,Java版本

    1.我们先设置一些常量数据 package cn.cutter.ztesoft.HuWeiMML.constrant; /** * @description: AAA接口常量设置 * @author: ...