Reputation: 93
As I know I can make a popup window in vs 2010 using MessageBox.Show() method. But it is not available in VS2015, so I want to know if there is any simple alternative to it. I am creating a web application using visual studio C# and no class System.Windows.Forms is available as given in the link.
Upvotes: 0
Views: 1717
Reputation: 3366
I suspect you already have an answer to this but here is how I solved a similar problem using VS2015.
var messageDialog = new MessageDialog("Smaller Text Message", "Large Text Message");
messageDialog.Commands.Add(new UICommand("Try again", new UICommandInvokedHandler(this.emailRetryPasswordRetrieval)));
messageDialog.Commands.Add(new UICommand("Cancel", new UICommandInvokedHandler(this.emailRetryPasswordRetrieval)));
await messageDialog.ShowAsync();
Then in the method emailRetryPasswordRetrieval
private void emailRetryPasswordRetrieval(IUICommand command)
{
if (command.Label.Equals("Try again"))
{
mymethod();
}
if (command.Label.Equals("Cancel"))
{
anothermethod();
}
}
and dont forget to add:
using Windows.UI.Popups;
Upvotes: 0