You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-15 22:56:30 +09:00
transferred from trunk/Generation3 of lidgren-network
This commit is contained in:
42
Samples/ChatClient/Form1.cs
Normal file
42
Samples/ChatClient/Form1.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
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;
|
||||
using SamplesCommon;
|
||||
|
||||
namespace ChatClient
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
textBox1.KeyDown += new KeyEventHandler(textBox1_KeyDown);
|
||||
}
|
||||
|
||||
void textBox1_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return)
|
||||
{
|
||||
string txt = textBox1.Text.Trim();
|
||||
Program.Input(txt);
|
||||
textBox1.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.SettingsWindow == null || Program.SettingsWindow.IsDisposed)
|
||||
Program.SettingsWindow = new NetPeerSettingsWindow("Client settings", Program.Client);
|
||||
if (Program.SettingsWindow.Visible)
|
||||
Program.SettingsWindow.Hide();
|
||||
else
|
||||
Program.SettingsWindow.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user