When I click a button, I want a box to popup on the screen and display a simple message. Nothing fancy really. How would I do that?
Just type mbox then hit tab it will give you a magic shortcut to pump up a message box. Note: This only works in Visual Studio.
To add an alert window to the Form, create a handler for the Button Click event by simply double clicking on the button. Now, copy and paste the following C# code snippet to the button click event handler. This code creates a PopupNotifier, sets its title and text and openss the popup.
Select Edit Website to open your website editor. Select the Website tab at the top of your editor then select Popup from Website Add-Ons. Customize your pop-up box. Enable Pop-up: Toggle this feature to turn your pop-up box on and off.
System.Windows.Forms.MessageBox.Show("My message here");
Make sure the System.Windows.Forms
assembly is referenced your project.
Just type mbox
then hit tab it will give you a magic shortcut to pump up a message box.
Try this:
string text = "My text that I want to display";
MessageBox.Show(text);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With