Typing without echo into a text box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I'm using a RichTextBox (but maybe something else would be more
appropriate). When I type something into it I don't want what I type to show
up automatically. Instead, I want to catch each keystroke and manually
selectively write the characters into it under program control. I can catch
the keystrokes fine, but how do I keep them from showing up automatically as
I type them?

Thanks,
Ray
 
Ray Mitchell said:
Hello,

I'm using a RichTextBox (but maybe something else would be more
appropriate). When I type something into it I don't want what I type to show
up automatically. Instead, I want to catch each keystroke and manually
selectively write the characters into it under program control. I can catch
the keystrokes fine, but how do I keep them from showing up automatically as
I type them?

Thanks,
Ray




I figured it out. Thanks anyway:


private void rtfTerminal_KeyDown(object sender, KeyEventArgs e)
{
// prevent echo into control
e.SuppressKeyPress = true;
// Show in logging text box
Log(LogMsgType.Outgoing,
Convert.ToString(Convert.ToChar(e.KeyValue)));
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top