G
Guest
I posted some questions about text boxes and received a reply which partially
resolved the issues.
1. I want to construct a text box (or rich text box) where if you type a
space a dot character appears in the box. (like MS Word when the formatting
characters are displayed). Following advice from Larry Serflaten I created a
sub to check for Key Down events and inserted the following:
If e.KeyCode = 32 Then
e.Handled = True
RichTextBox1.SelectedText = Chr(183)
End If
This puts the dot in the text box when you hit the spacebar, but it also
puts a space character after the dot. Is there some keyboard buffer which
needs to be cleared as well? I thought the e.Handled statement was inserted
to take care of that but it clearly doesn't.
2. I want to be able to change the insert mode from Insert to Overwrite,
which I am able to do with a Rich Text box, (but not a normal text box). How
can I interrogate the Rich Text box to determine which mode it is in? Is
there a property somewhere which shows this? (This is so I can display on the
form an indication of what the currently active insert mode is.)
Grateful for any assistance.
resolved the issues.
1. I want to construct a text box (or rich text box) where if you type a
space a dot character appears in the box. (like MS Word when the formatting
characters are displayed). Following advice from Larry Serflaten I created a
sub to check for Key Down events and inserted the following:
If e.KeyCode = 32 Then
e.Handled = True
RichTextBox1.SelectedText = Chr(183)
End If
This puts the dot in the text box when you hit the spacebar, but it also
puts a space character after the dot. Is there some keyboard buffer which
needs to be cleared as well? I thought the e.Handled statement was inserted
to take care of that but it clearly doesn't.
2. I want to be able to change the insert mode from Insert to Overwrite,
which I am able to do with a Rich Text box, (but not a normal text box). How
can I interrogate the Rich Text box to determine which mode it is in? Is
there a property somewhere which shows this? (This is so I can display on the
form an indication of what the currently active insert mode is.)
Grateful for any assistance.