0
Worked a treat. Thanks very much.
0
Peter,
That won't fire in Key_Press. I done your code in Key_Down and now it's firing.
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
switch (e.KeyCode)
{
case Keys.Return:
/* if (TELNET_CLIENT != null && TELNET_CLIENT.Connected)
{
string TEXT_TO_SEND = rtbInput.Text.Trim();
if (!string.IsNullOrEmpty(TEXT_TO_SEND))
{
UpdateHistory(TEXT_TO_SEND);
bgwMain.RunWorkerAsync(TEXT_TO_SEND + Environment.NewLine);
byte[] BYTES_TO_SEND = Encoding.ASCII.GetBytes(TEXT_TO_SEND + "\n");
TELNET_CLIENT.BeginSend(BYTES_TO_SEND, 0, BYTES_TO_SEND.Length, SocketFlags.None, new AsyncCallback(SocketSend), TELNET_CLIENT);
}
}
rtbInput.Clear();*/
MessageBox.Show("Pressed Enter");
break;
case Keys.Escape:
//rtbInput.Clear();
MessageBox.Show("Pressed Escape");
break;
case Keys.Up:
MessageBox.Show("Pressed Up Arrow");
break;
}
}