DmitryGaravsky / AutoClosingMessageBox

The MessageBox which automatically closes after the specific timeout.
MIT License
40 stars 14 forks source link

Feature Request for Show() #7

Closed jftuga closed 3 years ago

jftuga commented 3 years ago

Would you consider adding something like this:

public static void Show2(string text,
        string caption = null, int timeout = 1000,
        MessageBoxButtons buttons = MessageBoxButtons.OK, DialogResult defaultResult = DialogResult.None)

Notice the void return type. I am not using System.Windows.Forms and would prefer not to import it just for this function since I don't care about the return value anyway. Also Show2 could probably be renamed to something more descriptive, but I am not sure what that should be.

Right now, I have to fully define all my variable types such as System.Windows.Controls.TextBox instead of just TextBox (and ListBox) since both System.Windows.Controls and System.Windows.Forms define these exact same data types.

Thank you.

DmitryGaravsky commented 3 years ago

Hi, thank you for your interest! As far as I can see you have tried to use the AutoClosingMessageBox in WPF, so I have added support of WPF in the context of .NET5 support and Win/WPF feature.

You can build the AutoClosingMessageBox library using the AutoClosingMessageBox.Net5.Wpf.sln solution.

Thank you.

jftuga commented 3 years ago

This is awesome.Thank you for adding this in -- I really appreciate it!