ModernMessageBoxLib 发布
ModernMessageBoxLib
ModernMessageBoxLib is a WPF library in .Net 4.5 By using ModernMessageBoxLib, you can create a ModernMessageBox with a single code.
Todo list
- [x] Basic MessageBox
- [x] Input Window
- [x] Waiting window
- [ ] Color Picker
Screenshots
ModernMessageBox
IndeterminateProgressWindow
Import
We are strongly recommend you to use Nuget to import the package. Run this command in Package Manage Console:
1 | PM> Install-Package ModernMessageBoxLib |
(See more in Nuget)
Or you can download it on Release Page.
Get Started
ModernMessageBox
Before start using, you should specify Language and Background and Foreground. See
QModernMessageBox.MainLang
QModernMessageBox.GlobalBackground
QModernMessageBox.GlobalForeground
Example:
1 | QModernMessageBox.MainLang = new QMetroMessageLang() { |
In this example, The button text of the ModernMessageBox set to Chinese and Background set to white with 60% opacity and Foreground set to Black.
Those setting will use as default in ModernMessageBox.
The default Background in MessageBox is Black, 60% Opacity and the Foreground is White
The default lang is in English
In background setting, you can use a color with not fully solid. In this way, the window will have a Gaussian Blur background in Win10 1803+ In win7/8/8.1 or early version of win10, it will still use the solid color as background. If you don’t want a gaussian blur, just set the color solid.
In common cases, you can create a MetroMessageBox with the following code
1 | QModernMessageBox.Show("The quick brown fox jumps over the lazy dog.", "hello world",QModernMessageBox.QModernMessageBoxButtons.YesNoCancel,ModernMessageboxIcons.Warning); |
Or using the QT way:
1 | QModernMessageBox.Warning("The quick brown fox jumps over the lazy dog.", "hello world"); |
Customize:
1 | var msg = new ModernMessageBox("The quick brown fox jumps over the lazy dog.\n", "hello world", ModernMessageboxIcons.Info, "CSharp", "Java", |
IndeterminateProgressWindow
Before start using, you should specify Background and Foreground. See:
IndeterminateProgressWindow.GlobalBackground
IndeterminateProgressWindow.GlobalForeground
Usage:
1 | var win = new IndeterminateProgressWindow("Please wait while we are installing the virus into your computer. . ."); |
See more in the XML document comment.
About
Using this library means you agree the MIT Licence. Build with ❤ By Saber0905 in SakuraTrak Studio