D
dani kotlar
This seems to be a simple question:
How do I get the program to react after text was typed into a test box
and Enter was pressed?
I tried to write a KeyDown event. The program compiles and runs, but
when I enter text and press Return nothing happens. The debugger also
gets stuck in this point. Here is the KeyDown I wrote:
private void inputTextBox_KeyDown(object sender, KeyEventArgs
e)
{
try
{
if(e.KeyCode == Keys.Enter)
{
writer.Write("CLIENT>>> " + inputTextBox.Text);
displayTextBox.Text +=
"\r\nCLIENT>>> " + inputTextBox.Text;
inputTextBox.Clear();
}
}
catch(SocketException ioe)
{
displayTextBox.Text += "\nError writing object";
}
}
What is wrong?
Danny K
How do I get the program to react after text was typed into a test box
and Enter was pressed?
I tried to write a KeyDown event. The program compiles and runs, but
when I enter text and press Return nothing happens. The debugger also
gets stuck in this point. Here is the KeyDown I wrote:
private void inputTextBox_KeyDown(object sender, KeyEventArgs
e)
{
try
{
if(e.KeyCode == Keys.Enter)
{
writer.Write("CLIENT>>> " + inputTextBox.Text);
displayTextBox.Text +=
"\r\nCLIENT>>> " + inputTextBox.Text;
inputTextBox.Clear();
}
}
catch(SocketException ioe)
{
displayTextBox.Text += "\nError writing object";
}
}
What is wrong?
Danny K