-
Notifications
You must be signed in to change notification settings - Fork 1
/
Menu.cs
68 lines (61 loc) · 1.69 KB
/
Menu.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
namespace pdachess
{
public partial class Menu : Form
{
public Menu()
{
InitializeComponent();
}
private void menuItem4_Click(object sender, EventArgs e)
{
this.Close();
}
private void menuItem2_Click(object sender, EventArgs e)
{
if ((textBox1.Text == "在此輸入使用者名稱") || (textBox1.Text == null) || textBox1.Text.Contains(' '))
{
MessageBox.Show("請輸入使用者名稱");
}
else
{
Form1 gamelocal = new Form1("Network", textBox1.Text);
try
{
gamelocal.Owner = this;
gamelocal.Show();
this.Hide();
}
catch { }
}
}
private void menuItem3_Click(object sender, EventArgs e)
{
Form1 gamelocal = new Form1("Local",null);
gamelocal.Owner = this;
gamelocal.Show();
this.Hide();
}
private void textBox1_GotFocus(object sender, EventArgs e)
{
if (textBox1.Text == "在此輸入使用者名稱")
textBox1.Text = "";
}
private void textBox1_LostFocus(object sender, EventArgs e)
{
if (textBox1.Text == "")
{
textBox1.Text = "在此輸入使用者名稱";
}
}
}
}