evanwon / wpfcustommessagebox Goto Github PK
View Code? Open in Web Editor NEWA WPF clone of the native Windows/.NET MessageBox with extra features like custom button text.
A WPF clone of the native Windows/.NET MessageBox with extra features like custom button text.
My executable is signed with a strong name. The reference for this one is not. I tried signing it with my strong name but it doesn't work. Someone help.
1>------ Build started: Project: ProjectName, Configuration: Debug Any CPU ------
1>CSC : warning CS8002: Referenced assembly 'WPFCustomMessageBox, Version=1.0.7.39267, Culture=neutral, PublicKeyToken=null' does not have a strong name.
1>CSC : warning CS8002: Referenced assembly 'WPFCustomMessageBox, Version=1.0.7.39267, Culture=neutral, PublicKeyToken=null' does not have a strong name.
Hi All,
Your custom message box has been not lost focus or owner form when I moved form by Alt+Tab.
But MessageBox has been lost when I moved form by Alt+Tab.
How to set only focus custom message box at one form?
The library works fine under WPF Core 3.1 (did not try it under Core 3.0). But Packages displays restore warning. I thought that might be your 1.0.9 fork but that has the same targeting warning.
Package 'WPFCustomMessageBox 1.0.7' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.
Thanks for creating this! Really improved the ability for my current project's workflow to be clearly represented in the UI.
Greg
Maybe you can merge updates by other people?
For Example
Standard Windows MessageBoxes allow you to press Esc to cancel the window, which is available as long as there isn't a "yes/no" decision to be made.
Not sure if this was ever addressed for noobs or not, but I downloaded an old 2012 version of this for vs 2010.
Getting the normal dialog box to do something when choosing yes or no was incredibly hard, I have no idea how to actually utilize this past the visual aspect as I get this error. Error 2 'WPFCustomMessageBox.CustomMessageBox' does not contain a definition for 'bye'
DialogResult result = CustomMessageBox.ShowCustomYesNo("Hi", "bye", "hello", "goodbye", MessageBoxImage.Asterisk);
if (result == CustomMessageBox.yes);
{
Process.Start("process.exe","test");
}
else
{
System.Windows.Forms.Application.ExitThread();
}
They always show the english (hardcoded) texts instead of the localized labels like 'Ja/Nein/Abbruch' in german for example.
You can add to Image_MessageBox the follwing things to make it seem like the original MessageBox:
VerticalAlignment="Top"
Margin="30,20,0,0"
This way the image will not move around in case of long messages.
Like the regular MessageBox
methods, CustomMessageBox
needs overloads of the various Show
methods which take a Window
parameter.
Otherwise, there is no way to specify the parent window and make the message box be modal for that window.
Add additional overrides for the Show-methods to support a mix of caption strings and MessageBoxButtons. I.e.:
CustomMessageBox.ShowOKCancel(
"Are you sure you want to eject the nuclear fuel rods?",
"Confirm Fuel Ejection",
MessageBoxButton.Ok,
"Don't do it!");
Due to the number of possible combinations, this might get a little bit tedious...
Can you explain why we need to invoke Message Box in STA.
I'm trying to re-create your code for learning purpose.
I'd like to see the ability to set a specified message box width as versus depending upon the length of the text that you put inside the text box. Is this a planned feature?
When a button is focused in Windows 8, it is not visibly differentiated from the others.
Not an issue, but a suggestion...
I got a source copy and added a scrollViewer around the text block, added max height and width to the window. I have some really long messages I want to display. Perhaps a feature you could add if you see fit?
Nice job BTW,
Regards,
Hobie
No ability to use a custom icon ?!?!
I don't see any custom icons in the code.
You can add a default MessageBoxResult in the DisplayButtons method. That way, if the user clicks on the close button of the window, the result returned will not be None in case of Yes/No/Cancel message boxes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.