messagebox

How to show a MessageBox with a checkbox?

我的未来我决定 提交于 2019-11-29 17:16:19
问题 I would like to create a MessageBox that has Yes / No buttons AND a checkbox. The application is a picture resizer and it will be re-sizing a number of pictures at once; in the process it will check if the new location filename exists with the option to overwrite it. The MessageBox will give the user the option to overwrite any new files if desired, while the checkbox will prevent having to click Yes x number of times if they want to overwrite every file. How do I add a checkbox to a

Is there a non-blocking version of MessageBox.Show (or something like it)?

吃可爱长大的小学妹 提交于 2019-11-29 15:59:21
问题 Long-delayed update I'm accepting MUG4N's answer to this question, and I also want to respond to some of the criticisms that were raised against it. ChrisF said: ...you can't make UI calls directly from background threads. This is a blanket statement, and is not 100% true. Let me just point out a few facts: You can actually make UI calls all you want if you set Control.CheckForIllegalCrossThreadCalls = false . "Ack!" I hear you saying. "Don't ever do that!" Yes, yes -- but why ? The answer:

How to handle Message Boxes while using webbrowser in C#?

断了今生、忘了曾经 提交于 2019-11-29 15:50:50
问题 I'm using this webbrowswer feature of C#. Trying to log in a website through my application. Everything goes fine, except when a wrong ID or password is entered there's little message box (that is set on the webpage itself) which pops up and blocks everything until "Ok" is clicked. So the question is: Is there any possible way to manage this little window (like reading the text inside of it)? If it is then great! But if there's no way to do that then is there anyway to simply make this

Python tkinter 8.5 import messagebox

二次信任 提交于 2019-11-29 12:05:29
The following code runs fine within IDLE, but otherwise I get "NameError: global name 'messagebox' is not defined". However, if I explicitly state from tkinter import messagebox , it runs fine from where ever. from tkinter import * from tkinter import ttk root = Tk() mainFrame = ttk.Frame(root) messagebox.showinfo("My title", "My message", icon="warning", parent=mainFrame) Why does IDLE not need the explicit import statement but elsewhere it is required? the messagebox is a separate submodule of tkinter, so simply doing a complete import from tkinter: from tkinter import * doesn't import

Which control to use for quick text input (inputbox)?

社会主义新天地 提交于 2019-11-29 10:53:01
I need a quick text input dialog box (MessageBox with a single text box in it). Is there any control available or should I use a form? I just want user to enter some ID. And in other occasion I want 2 texboxes for username and password. Microsoft.VisualBasic.dll has an InputBox method which you can use from C# to get a single string. For example (Add a reference to Microsoft.VisualBasic.dll first) using Microsoft.VisualBasic; string response = Interaction.InputBox("Enter a string:", "MyApp", "DefaultString", 0, 0); Othewise, you'll have to make your own form. simple one is inputbox 来源: https:/

C# formatting a MessageBox

半世苍凉 提交于 2019-11-29 10:08:58
I want to display a MessageBox alerting the user that the process is complete, and giving a breakdown on how long each stage of the process took. I've got the text that I want to display formatted appropriately, but the default font of the MessageBox class is not mono-width. As far as I can tell, there's no way to specify the font that the text displays with. Is there an out-of-the-box library somewhere that I can use for this, or am I going to have to write one up myself? Any reason not to just create a Form with a textbox/label using a monospace font, then call Form.ShowDialog ? Sounds like

Force MessageBox to be on top of application window in .net/WPF

无人久伴 提交于 2019-11-29 06:25:22
问题 In my WPF app, I sometimes being up a System.Windows.MessageBox . When it is initially displayed, it is shown on top of my main application window, as I would like. Is there a way that I can force it to ALWAYS remain top of the main window? The problem I have is that when a MessageBox is displayed, users can then click on the main app window and bring it to the front, meaning the MessageBox becomes hidden from view. In this case the user might not realize it's there, or forget about it, and

How can I show a message box with details in WinForms?

蓝咒 提交于 2019-11-29 05:38:26
Just now I noticed that Visual Studio shows a message box with details when a property is set to an invalid value. For example: Is it possible to make this type of message box in WinForms? I have tried the following code: MessageBox.Show("Error in Division Fill.\n" + ex.Message, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxOptions.RightAlign); But this produced the following error: Error 24 The best overloaded method match for 'System.Windows.Forms.MessageBox.Show(string, string, System.Windows.Forms.MessageBoxButtons, System.Windows.Forms.MessageBoxIcon, System

MessageBox.Show— font change?

我们两清 提交于 2019-11-29 05:30:41
I'm using the MessageBox class to show errors to users, and while that might not be the right behavior, it's very convenient. This is a touchscreen application, however, so I need the 'ok' button to be much larger than it is (curse my inordinately large fingers!). I think that if I increase the font size in the dialog box, I should be ok. Is there a way to do that? Or really, is there any way to increase the dialog size? Thanks As far as I'm aware you can't, as the 'normal' dialog boxes are using your default system font settings. Roll your own is probably the best way forward. It's fairly

Python PyQt5: How to show an error message with PyQt5

夙愿已清 提交于 2019-11-29 05:16:51
In normal Python (3.x) we always use showerror() from the tkinter module to display an error message but what should I do in PyQt5 to display exactly the same message type as well? Qt includes an error-message specific dialog class QErrorMessage which you should use to ensure your dialog matches system standards. To show the dialog just create a dialog object, then call .showMessage() . For example: error_dialog = QtWidgets.QErrorMessage() error_dialog.showMessage('Oh no!') Here is a minimal working example script: import PyQt5 from PyQt5 import QtWidgets app = QtWidgets.QApplication([]) error