messagebox

MessageBox loses focus in maximized MDI form

ⅰ亾dé卋堺 提交于 2019-12-06 03:22:32
I have an MDI application (written in .NET 2.0) which lets users open multiple child forms. The child forms are always maximized inside the MDI parent. When the MDI parent is maximized and I attempt to do a MessageBox.Show, the MessageBox doesn't show. If I do an alt-tab (or even just press alt) the MessageBox pops to the front. Any ideas how to make that sucker show up to begin with? This is only a problem when the MDI parent is maximized... Try using MessageBox.Show(Window owner, string message, string caption) Setting the MDI application as owner so the MB is shown in the front Ah, you

How to validate a messagebox popup in c#?

*爱你&永不变心* 提交于 2019-12-06 00:20:25
I was writing some tests and try to validate that some system messagebox is popping up. Like in http://www.dotnetperls.com/messagebox-show . However, the class MessageBox is for creating the messagebox. How shall I capture and validate an system generated one and operate on it? eg: The actions are: 1.click on some execute file. 2.validate a warning messagebox pop up 3.click on yes/no on the messagebox Any hint please? One choice is to use White automation framework. For example: Window messageBox = WindowFactory.Desktop .DesktopWindows() .Find(w => w.Title.Contains("MessageBoxTitle")); Button

Problem with formatting a string with String.Format in C#

独自空忆成欢 提交于 2019-12-05 22:32:53
I need to print a string in a message box in specific format for which i am using code similar to as shown below: string text=""; for (int i=0; i<n; i++) { a=.. b=.. c=.. text += String.Format("{0, -8} {1,-4} {2,8}", a, b, c); } MessageBox.Show(text); So for following set of values: XYZ,ABC,100 X,ABC,100 I get following output: XYZ ABC 100 X ABC 100 So you can see the second line is not well formatted. Probably this is happening because i am printing this in MessageBox. The space a character and a 'space' takes is different. Any solution for this? Bob Black Try using a \t to insert tabs

How to display message box when starting up an Inno Setup installer

試著忘記壹切 提交于 2019-12-05 20:50:58
How to display a message box information, when starting up an installer made in Inno Setup? Like this setup of Reloaded Games does: Call the MsgBox function from the InitializeSetup event function : function InitializeSetup(): Boolean; begin MsgBox('Some message.', mbInformation, MB_OK); Result := True; end; 来源: https://stackoverflow.com/questions/40378046/how-to-display-message-box-when-starting-up-an-inno-setup-installer

Can I add controls to the C# MessageBox?

非 Y 不嫁゛ 提交于 2019-12-05 14:35:31
Could I add some custom control to the standard Message Box for read input value, for example text fields for user name and password, or I should create custom winform with "Ok,Cancel" buttons and text fields? Related: Which control to use for quick text input (inputbox)? Quintin Robinson Create your own. Creating a custom modal (or otherwise) input dialog isn't all that difficult and you can built the extensibility you need for reuse. public class ValueHolder { public string SomeInput { get; set; } public DialogResult Result { get; set; } } public class GimmeValues : Form { //... HAS A

How do I capture the results of a YESNOCANCEL MessageBox without gotos/labels in NSIS installer scripting?

╄→гoц情女王★ 提交于 2019-12-05 13:04:59
I would like to know how to use a YESNOCANCEL MessageBox in conjunction with IF logic from LogicLib.nsh in NSIS installer scripting to avoid having to use labels and gotos. Is there any way to capture the result of a MessageBox in a variable of some kind? Also, I know there are better things than NSIS out there, but using something else isn't a possibility at this point. =( Note the {WHAT GOES HERE??} in the below code. If this was just an If...Else... it would work fine. Thanks for the help ${If} ${Cmd} `MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION "PROGRAM X is already installed. Click YES

Why does System.Windows.MessageBoxImage have enumeration sub-items with the same value?

让人想犯罪 __ 提交于 2019-12-05 10:34:39
I'm trying to write my own abstraction over the MessageBoxImage enumeration, and see that MessageBoxImage is defined as: namespace System.Windows { public enum MessageBoxImage { None = 0, Error = 16, Hand = 16, Stop = 16, Question = 32, Exclamation = 48, Warning = 48, Asterisk = 64, Information = 64, } } How does the Show method determine whether to display an Error image or a Hand image? How would I write a method which takes a MessageBoxImage type, and return a CustomMessageBoxImage type which maps to the MessageBoxImage type, as I can't include both MessageBoxImage.Error and MessageBoxImage

How can I supress Delphi DataSnap error message dialogs?

佐手、 提交于 2019-12-05 10:23:20
We run a DataSnap Delphi 2009 application on Windows 2003 Server. DataSnap Client and Server are on the same computer, using DCOM over Borland Socketserver. The client runs a background batch job. Sometimes, we discover that the client can not connect to the server application and displays a message dialog on the server desktop indicating for example "Could not connect to server. Network path could not be found." or "Objectexporter not found." Our Delphi client code never uses a message dialog to show errors or exceptions, instead we use try ... except .. finally ... end and logging to handle

NumberField prompt in ExtJS

喜你入骨 提交于 2019-12-05 08:08:39
问题 I'm trying to show a MessageBox.prompt with a numberfield instead of a regular textfield. I couldn't go around creating a new MessageBox so I decided to just use a validator instead, but I'm having some trouble with it too. So anything will work for me, either a number validator for a MessageBox or a MessageBox with a numberfield instead of textfield. Here's my MessageBox... var msgbox = Ext.Msg.prompt('Quantity', 'Enter a number',function(btn, text){} ) Any ideas for this? UPDATE I managed

WPF MessageBox not waiting for result [WPF NotifyIcon]

非 Y 不嫁゛ 提交于 2019-12-05 04:57:13
I am using WPF NotifyIcon to create a System Tray service. When I show a messagebox, it shows up for half a second and then disappears immediately without waiting for input. This kind of situation has happened before , and the usual advice is to use an overload which accepts a Window parameter. However, being a System Tray service, there is no window to use as a parent, and null is not accepted in its place. Is there any way to make the MessageBox wait for user input short of creating a custom MessageBox window myself? You don't need to create a proxy window for this. Just add