473,396 Members | 2,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Forcing RichTextBox to ignore a key pressed

Udi
Hi all,
I have a derived class from RichTextBox.
I'm overriding IsInputKey() to deal with my speciffic keys.
I'm catching Keys.Space | Keys.Control when the user presses
Ctrl+space,
however, I don't want my derived control printing the 'space' charecter
in this situation.
returning false from IsInputKey() solve this issue but it is not good
for me because I'm losing the text box focus in this case.
What do I do then?

Thanks!

Apr 23 '06 #1
1 2561
If you are using .NET Framework 2.0, then on KeyEventArgs (the second
parameter of KeyDown or whatever event you handle), there is a member
called SuppressKeyPress.
Set it to true.

I hope it works.

Apr 23 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Walter L. Williams | last post by:
VS.NET 2K3 and .NET 1.1 I'm having a problem with RichTextBox allocating huge amounts of memory for text. I have recreated the problem in the attached sample which, when the button is pressed,...
0
by: Kaki | last post by:
I have a RichTextBox with AcceptsTab set to true. When Ctrl is held down, pressing Tab does not trigger KeyPress or KeyDown/Up events. If AcceptsTab is false, the RichTextBox never knows if Tab...
1
by: Sachin | last post by:
If an image is inserted in the RichTextBox at runtime, how to drag/move it inside the RichTextBox with the help of mouse, just like we can move any control on the form during design time. Please...
2
by: Leon Friesema | last post by:
Hiyall! I have a RichTextBox inside a UserControl which should be able to indent a block off text (or UnIndent for that matter) like the SourceEditor of VS2003 or WinWord does. All controls on...
1
by: Jesper | last post by:
Hi, Is it possible to scroll a RichTextBox programmatically to a given text selection in it, such that the selected text becomes viewable. regards. Jesper.
7
by: Richard | last post by:
When you give focus to a RichTextBox, then it goes to the textCursor, but i don't want to give the richtextbox focus, cause there is being written a lot in it, and I have to do something else at...
0
by: John Smith | last post by:
I have text files and I get binary offsets of text portion of these files from VB6 program with RichTextBox. I use VB.Net 2003 and need to select and highlight the text between given offsets....
8
by: Dennis | last post by:
How can I tell if the Insert Mode is on or off? -- Dennis in Houston
3
by: Stuart Nathan | last post by:
In VB - Visual Studio 2003 As I understand it, in the KeyDown event of a RichTextBox, I can put If e.KeyCode = Keys.Return then e.Handled = False and this will prevent the Enter key being added...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.