messagebox

ASP.NET Web Application Message Box

隐身守侯 提交于 2019-11-26 09:10:28
问题 In an asp.net windows forms application, in the C# code behind you can use: MessageBox.Show(\"Here is my message\"); Is there any equivalent in a asp.net web application? Can I call something from the C# code behind that will display a message box to the user? Example usage of this: I have a button that loads a file in the code behind. When the file is loaded or if there is an error I would like to popup a message to the user stating the result. Any ideas on this? 回答1: You want to use an

How to suppress a dialog box displayed by code that I can't change?

孤者浪人 提交于 2019-11-26 08:33:17
问题 I have a Inproc COM Server from a 3rd party. One of the functions I call will display a error message dialog box if it traps a specific type of error. The issue is I am trying to process data in bulk, and the data source I am using is causing that error dialog to pop up a lot. This would not be a issue if it spawned 1000 dialog boxes, but instead it blocks and the function does not return until you press OK. How can I suppress the dialog from showing up, or programmatically press OK? Here is

WPF MessageBox window style

て烟熏妆下的殇ゞ 提交于 2019-11-26 06:28:51
问题 How to apply the default Windows style to the standard MessageBox in WPF? For example, when I execute next code: MessageBox.Show(\"Hello Stack Overflow!\", \"Test\", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation); I\'m getting message box: But in WinForms everything is OK with style: MessageBox.Show(\"Hello Stack Overflow!\", \"Test\", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); 回答1: According to this page, WPF picks up the old styles for some of the controls. To get rid

Show a popup/message box from a Windows batch file

最后都变了- 提交于 2019-11-26 05:55:02
问题 Is there a way to display a message box from a batch file (similar to how xmessage can be used from bash-scripts in Linux)? 回答1: I would make a very simple VBScript file and call it using CScript to parse the command line parameters. Something like the following saved in MessageBox.vbs : Set objArgs = WScript.Arguments messageText = objArgs(0) MsgBox messageText Which you would call like: cscript MessageBox.vbs "This will be shown in a popup." MsgBox reference if you are interested in going

How to create a custom MessageBox?

喜夏-厌秋 提交于 2019-11-26 05:35:57
问题 I\'m trying to make a custom message box with my controls. public static partial class Msg : Form { public static void show(string content, string description) { } } Actually I need to place some controls (a gridview) in this form and I have to apply my own theme for this window, so I don\'t want to use MessageBox . I want to call this from my other forms like Msg.show(parameters); I don\'t wish to create an object for this form. I know I can\'t inherit from Form class because it isn\'t

Close a MessageBox after several seconds

放肆的年华 提交于 2019-11-26 02:51:16
问题 I have a Windows Forms application VS2010 C# where I display a MessageBox for show a message. I have an okay button, but if they walk away, I want to timeout and close the message box after lets say 5 seconds, automatically close the message box. There are custom MessageBox (that inherited from Form) or another reporter Forms, but it would be interesting not necessary a Form. Any suggestions or samples about it? Updated: For WPF Automatically close messagebox in C# Custom MessageBox (using

Winforms-How can I make MessageBox appear centered on MainForm?

浪子不回头ぞ 提交于 2019-11-26 01:45:59
问题 Winforms-How can I make dialog boxes appear centered on MainForm? That is as opposed to be based on Normal windows default which renders them in the centre of the screen. In my case I have a small main form that may for example be positioned in a corner, the the MessageBox popup is displayed what seems a ways away. 回答1: It is possible with some servings of P/Invoke and the magic provided by Control.BeginInvoke(). Add a new class to your project and paste this code: using System; using System

Winforms-How can I make MessageBox appear centered on MainForm?

好久不见. 提交于 2019-11-25 21:45:51
Winforms-How can I make dialog boxes appear centered on MainForm? That is as opposed to be based on Normal windows default which renders them in the centre of the screen. In my case I have a small main form that may for example be positioned in a corner, the the MessageBox popup is displayed what seems a ways away. It is possible with some servings of P/Invoke and the magic provided by Control.BeginInvoke(). Add a new class to your project and paste this code: using System; using System.Text; using System.Drawing; using System.Windows.Forms; using System.Runtime.InteropServices; class