使用c#将Messagebox.show()置于其他应用程序的顶部 [英] Keep Messagebox.show() on top of other application using c#

查看:103
本文介绍了使用c#将Messagebox.show()置于其他应用程序的顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用c#??将Messagebox.show()保留在其他应用程序的顶部?

How to keep a Messagebox.show() on top of other application using c# ??

推荐答案

我尝试了donutboy提供的解决方案,它似乎不接受将0x40000(或40000)作为MessageBoxOptions枚举值的有效选项.

I tried the solution provided by donutboy and it doesn't seem to accept 0x40000 (or 40000) as a valid option as a MessageBoxOptions Enum value.

但是,我发现使用MessageBoxOptions.DefaultDesktopOnly具有相同的效果,并将MessageBox保持在顶部,直到用户确认为止.IE.

However I have found that using MessageBoxOptions.DefaultDesktopOnly has the same effect and keeps the MessageBox on top until it is confirmed by the user. ie.

MessageBox.Show("Hello there", "Prompt", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);

这可能是提供的最简单的本机解决方案.

This is likely the simplest native solution on offer.

这篇关于使用c#将Messagebox.show()置于其他应用程序的顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆