messagebox

How to get text and a variable in a messagebox

我的梦境 提交于 2019-12-03 16:24:40
问题 I just need to know how to have plain text and a variable in a messagebox. For example: I can do this: MsgBox(variable) And I can do this: MsgBox("Variable = ") But I can't do this: MsgBox("Variable = " + variable) 回答1: As has been suggested, using the string.format method is nice and simple and very readable. In vb.net the " + " is used for addition and the " & " is used for string concatenation. In your example: MsgBox("Variable = " + variable) becomes: MsgBox("Variable = " & variable) I

WPF MessageBox buttons aren't OS themed

我的未来我决定 提交于 2019-12-03 12:52:01
So the buttons of my message box in WPF aren't themed by the OS. I even tried this method and it didn't work. I have a manifest, I am running under Windows 7 Ultimate x86 and .NET Framework 4 Client Profile. EDIT: It works now. The changes you've made have been saved but you cannot view them whilst debugging in VS. To fix this, right click your project and click "Properties" and then go to "Debug". There is a checkbox at the bottom of the page named "Enable the Visual Studio hosting process" - un-tick this. It is recommended that you restart visual studio after making this change.

MVVM Exception Handling

人盡茶涼 提交于 2019-12-03 09:45:03
问题 I have a WPF Application that I have been trying to write in the MVVM style. If an Exception is thrown (like when a document is opened), I would like to display a MessageBox. Easy to do, but my code doesn't feel quite right because the MessageBox.Show call is in the ModelView. I thought that sort of thing is supposed to live in the View, but I'm not supposed to put code in the View. So the question really can be distilled down to what is the suggested way to display a MessageBox in MVVM? 回答1:

A Scrollable MessageBox in C#

你离开我真会死。 提交于 2019-12-03 08:34:26
I use Addin in VS2008, C#, and I need show messages (error messages and others). I don't know the length of messages, and therefore I want use Scrollable MessageBox. I have found this article from 2007 year: By Mike Gold July 30, 2007 http://www.c-sharpcorner.com/UploadFile/mgold/ScrollableMessageBox07292007223713PM/ScrollableMessageBox.aspx now, in 2011 any another good components ?? I want evaluate several components about it. Update: another component but older: MessageBoxExLib http://www.codeproject.com/KB/dialog/MessageBoxEx.aspx A customizable .NET Winforms Message Box. http://www

How to get text and a variable in a messagebox

夙愿已清 提交于 2019-12-03 05:35:12
I just need to know how to have plain text and a variable in a messagebox. For example: I can do this: MsgBox(variable) And I can do this: MsgBox("Variable = ") But I can't do this: MsgBox("Variable = " + variable) As has been suggested, using the string.format method is nice and simple and very readable. In vb.net the " + " is used for addition and the " & " is used for string concatenation. In your example: MsgBox("Variable = " + variable) becomes: MsgBox("Variable = " & variable) I may have been a bit quick answering this as it appears these operators can both be used for concatenation, but

Why isn't MessageBox TopMost?

落爺英雄遲暮 提交于 2019-12-03 05:26:25
问题 I recently found out that by default MessageBoxes were not the top most form when displayed by default and I was wondering if anyone knew any circumstances when you wouldn't want the messagebox to be shown on top of other windows? I found the issue when I started to show splash screens whilst loading an application, and it looked like my program was still running but there was a MessageBox behind the splash screen that was waiting for input.. The splash screen was shown on a different thread

Use Python Win32gui to check messagebox

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am writing a python unittest program. I want to check whether a messagebox appears after several seconds. I find FindWindow(className, windowName) in Win32gui can be used to detect a certain window. I want to know what classname and windowname stands for and whether it can check a message box. Meanwhile, what kinds of windows can FindWindow detect? Whether it can detect all kinds of windows? Meanwhile, can I use FindWindow to check whether a program is running. For example, check the word window to determine whether it is running? 文章来源:

WPF MessageBox window style

匿名 (未验证) 提交于 2019-12-03 01:59:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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 of it, you have to create a custom app.manifest file (Add

Open button on Messagebox

匿名 (未验证) 提交于 2019-12-03 01:40:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a WinForms application, and when it is finished running, displays a message box with just an OK button. Is it possible to have an OPEN button on the message box too? I found this code online: public static DialogResult Show ( string text , string caption , MessageBoxButtons buttons ); But it only gives basic commands, like Yes / No , OK / Cancel , etc. It doesn't show any open button. I want to OPEN a text file after my program has finished running. Any help would be greatly appreciated. 回答1: No, you can't have any other

C# MessageBox dialog result

南楼画角 提交于 2019-12-03 01:28:46
问题 I want to make a MessageBox confirmation. Here is the message box: MessageBox.Show("Do you want to save changes?", "Confirmation", messageBoxButtons.YesNoCancel); And I want to make something like this (in pseudocode): if (MessageBox.Result == DialogResult.Yes) ; else if (MessageBox.Result == DialogResult.No) ; else ; How can I do that in C#? 回答1: DialogResult result = MessageBox.Show("Do you want to save changes?", "Confirmation", MessageBoxButtons.YesNoCancel); if(result == DialogResult.Yes