Created
October 16, 2017 14:24
-
-
Save KrabCode/46e08c72621a037fa377f8008b7ee242 to your computer and use it in GitHub Desktop.
Shows a MessageBox with custom message, closes on OK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Text; | |
using System.Windows.Forms; | |
namespace Reminder | |
{ | |
public partial class Form1 : Form | |
{ | |
string header = "hi it's me your liver"; | |
string text = "no bad thoughts" + | |
System.Environment.NewLine + "run away instead"; | |
public Form1() | |
{ | |
InitializeComponent(); | |
} | |
private void Form1_Load(object sender, EventArgs e) | |
{ | |
showAlert(text); | |
} | |
private void showAlert(string s) | |
{ | |
if (MessageBox.Show(text, header, MessageBoxButtons.OK) == DialogResult.OK) | |
{ | |
Close(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment