C#中MessageBox.Show问题(让提示窗口不显示在任务栏中)
在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问题(让提示窗口不显示在任务栏中)的更多相关文章
- Delphi中,除了应用程序主窗口会显示在任务栏上,其它窗口默认都不会显示在任务栏.
Delphi中,除了应用程序主窗口会显示在任务栏上,其它窗口默认都不会显示在任务栏. Delphi中,除了应用程序主窗口会显示在任务栏上,其它窗口默认都不会显示在任务栏.没有MS开发环境中的ShowI ...
- 怎样让窗口不显示在任务栏和ALT+TAB中(隐藏窗口再嵌套,几乎是万能的办法)
之前想弄个像QQ旋风那样的悬浮窗口,就研究了下怎么让窗口不显示在任务栏中,方法其实很简单就是将窗口的扩张属性设置成WS_EX_TOOLWINDOW,MSDN中对该属性有详细介绍,代码如下: ::Set ...
- [转载]C#中MessageBox.Show用法以及VB.NET中MsgBox用法
一.C#中MessageBox.Show用法 MessageBox.Show (String) 显示具有指定文本的消息框. 由 .NET Compact Framework 支持. MessageBo ...
- winform中messageBox七个参数的使用(转载)
private void button1_Click(object sender, EventArgs e) { MessageBox.Show(" 1 个参数 ”); } private ...
- C# WinForm 中 MessageBox的使用详解
1.C# WinForm 中 MessageBox的使用详解:http://www.cnblogs.com/bq-blog/archive/2012/07/27/2611810.html
- 转:VC中MessageBox的常见用法
一.关于MessageBox 消息框是个很常用的控件,属性比较多,本文列出了它的一些常用方法,及指出了它的一些应用场合. 1.MessageBox("这是一个最简单的 ...
- JAVA中MESSAGEBOX,静态类直接引用
原文:JAVA中MESSAGEBOX,静态类直接引用 package cisdi.mes.wrm.mcode.serviceImpl; import javax.persistence.Entity; ...
- VC中MessageBox的常见用法
一.关于MessageBox 消息框是个很常用的控件,属性比较多,本文列出了它的一些常用方法,及指出了它的一些应用场合. 1.MessageBox("这是一个最简单的 ...
- DELPHI中MessageBox的用法
MessageBox对话框 输入控件的 ImeName属性把输入法去掉就默认为英文输入了 MessageBox对话框是比较常用的一个信息对话框,其不仅能够定义显示的信息内容.信息提示图标,而且可以 ...
随机推荐
- 转Centos7.0进入单用户模式修改root密码
Centos7.0进入单用户模式修改root密码 启动Centos7 ,按空格让其停留在如下界面. 按e进行编辑 在UTF-8后面输入init=/bin/sh 根据提示按ctrl+x 得如下图 输 ...
- CSS3中很容易混淆的transform,translate,transition。如何去区分,以及综合写法。
属性 含义 transition(过渡) 用于设置元素的样式过度,和animation有着类似的效果,但细节上有很大的不同 transform(变形) 用于元素进行旋转.缩放.移动或倾斜,和设 ...
- 大叔学ML第三:多项式回归
目录 基本形式 小试牛刀 再试牛刀 调用类库 基本形式 上文中,大叔说道了线性回归,线性回归是个非常直观又简单的模型,但是很多时候,数据的分布并不是线性的,如: 如果我们想用高次多项式拟合上面的数据应 ...
- Python编程练习:使用 turtle 库完成六边形的绘制
绘制效果: 源代码: # 六边形 import turtle turtle.setup(650, 350, 200, 200) turtle.penup() turtle.pendown() turt ...
- IM系统的MQ消息中间件选型:Kafka还是RabbitMQ?
1.前言 在IM这种讲究高并发.高消息吞吐的互联网场景下,MQ消息中间件是个很重要的基础设施,它在IM系统的服务端架构中担当消息中转.消息削峰.消息交换异步化等等角色,当然MQ消息中间件的作用远不止于 ...
- Ubuntu18.04搭建nodejs环境
首先安装sudo apt install curl 然后安装命令(当前最新版本是0.33.2,最新版本可以在https://github.com/creationix/nvm查看): curl -o- ...
- 机器学习入门05 - 泛化 (Generalization)
原文链接:https://developers.google.com/machine-learning/crash-course/generalization 泛化是指模型很好地拟合以前未见过的新数据 ...
- Scala - 快速学习02 - 搭建开发环境
1- 下载与安装 下载链接:http://www.scala-lang.org/download/ CMD To run Scala from the command-line, simply dow ...
- 关于DB Link
概述 DB Link是一个定义了本地数据库到远程数据库路径的对象,是schema object,它是单向连接 通过DB Link可查询remote数据库的对象及运行其程序 在分布式环境里,DB Lin ...
- pickle模块及其API
模块:pickle 所包含API列表: pickle.dumps : 把任意对象序列化成一个bytes pickle.dump : 直接把对象序列化后写入一个file-like Object pick ...