Tag: messagebox

如何自定义消息框

我正在做C#应用程序,我想改变消息框的样式。 有可能吗? 示例:更改按钮样式,前景色等。

如何在messagebox中获取DataGridView单元格值?

如何在C#中的MessageBox中编写DataGridView单元格值?

带MVVM模式的WPF MessageBox?

假设我想向用户显示一些validation错误。 在MVVM模式中,我可以有一个标签绑定到我的viewmodel上的某个属性。 但是,如果我想在严格遵守MVVM模式的同时显示消息框,该怎么办呢? 我的viewmodel会绑定什么,以及它将如何触发创建/显示消息框?

强制以编程方式关闭MessageBox

我来给你一个背景。 我们有一个应用程序(中等大小)在各个地方(数百个)使用MessageBox.Show(….)。 这些消息框是工作流程的一部分,用于通知,警告或从用户获取输入。 如果没有活动,应用程序应该在一定时间后自动注销。 我们要求在注销应用程序时,只需清理会话数据,清除视图并隐藏自身,以便在下次启动时,它不必执行启动过程,这在时间上是昂贵的。 一切正常,但是在屏幕上有一些消息框并且用户离开机器而没有响应消息框然后由于没有活动使应用程序退出的情况下。 问题是消息框不会消失。 如何在隐藏应用程序时关闭打开的消息框(如果有的话)? 谢谢。

如何在Web应用程序中显示错误消息框asp.net c#

我有一个ASP.NET Web应用程序,我想知道如何在抛出exception时显示错误消息框。 例如, try { do something } catch { messagebox.write(“error”); //[This isn’t the correct syntax, just what I want to achieve] } [消息框显示错误] 谢谢

如何在字符串中写上标并使用MessageBox.Show()显示?

我试图使用消息框输出该区域,它应显示为,例如,256单位^ 2 … 我怎么能写上标(为权力)和下标(如氧气的O2)? 这个人在这里添加了一个像(TM)的上标: 将TM superScript添加到字符串 我希望我清楚自己! 在此先感谢,对由此带来的任何不便表示歉意……

MessageBox中的粗体文本

如何使用C#在MessageBox.Show显示的对话框中以粗体显示文本?

如何抑制由我​​无法更改的代码显示的对话框?

我有来自第三方的Inproc COM服务器。 如果它捕获特定类型的错误,我调用的函数之一将显示错误消息对话框。 问题是我正在尝试批量处理数据,而我使用的数据源导致错误对话框弹出很多。 如果它产生1000个对话框,这不会是一个问题,而是它会阻塞,直到您按OK才会返回该function。 如何禁止显示对话框,或以编程方式按OK? 这是一个调用堆栈的副本,​​因为它正在等待我按OK [管理到原生过渡] > System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID,int reason,int pvLoopData)Line 2198 + 0x1e bytes C# System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason,System.Windows.Forms.ApplicationContext context)Line 3422 + 0x1b bytes C# System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason,System.Windows.Forms.ApplicationContext context)Line 3306 + 0xc bytes C# System.Windows.Forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form mainForm)第1495行+ 0x31字节C# UniversalDataImporter.exe!UniversalDataImporter.Program.Main()第18行+ 0x1d字节C# [原生于管理过渡] [管理到原生过渡] mscorlib.dll!System.AppDomain.ExecuteAssembly(string assemblyFile,System.Security.Policy.Evidence assemblySecurity,string [] args)2023行+ 0x18字节C# Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()+ 0x27 bytes mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(对象状态)第68行+ 0x27字节C# mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext,System.Threading.ContextCallback callback,object […]