Kyaria

Clicker_Game [MSG_BOX] V 1.0

Apr 4th, 2017
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.57 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace Clicker_Game
  12. {
  13.     public partial class Form2 : Form
  14.     {
  15.         static Form2 newMessageBox;
  16.         static string Button_id;
  17.  
  18.         public Form2()
  19.         {
  20.             InitializeComponent();
  21.         }
  22.  
  23.         private void Form2_Load(object sender, EventArgs e)
  24.         {
  25.  
  26.         }
  27.  
  28.         public static string ShowBox(string txtMessage)
  29.         {
  30.             newMessageBox = new Form2();
  31.             newMessageBox.label1.Text = txtMessage;
  32.             newMessageBox.ShowDialog();
  33.             return Button_id;
  34.         }
  35.  
  36.         public static string ShowBox(string txtMessage, string txtTitle)
  37.         {
  38.             newMessageBox = new Form2();
  39.             newMessageBox.label1.Text = txtMessage;
  40.             newMessageBox.Text = txtTitle;
  41.             newMessageBox.ShowDialog();
  42.             return Button_id;
  43.         }
  44.  
  45.         private void button3_Click_1(object sender, EventArgs e)
  46.         {
  47.             Button_id = "3";
  48.             newMessageBox.Dispose();
  49.         }
  50.  
  51.         private void button2_Click_1(object sender, EventArgs e)
  52.         {
  53.             Button_id = "2";
  54.             newMessageBox.Dispose();
  55.             this.Close();
  56.         }
  57.  
  58.         private void button1_Click_1(object sender, EventArgs e)
  59.         {
  60.             Button_id = "1";
  61.             newMessageBox.Dispose();
  62.         }
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment