You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-14 22:26:29 +09:00
50 lines
1.1 KiB
C#
50 lines
1.1 KiB
C#
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();
|
|
}
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
{
|
|
string txt = textBox1.Text.Trim();
|
|
Program.Input(txt);
|
|
textBox1.Text = "";
|
|
}
|
|
}
|
|
}
|