473,378 Members | 1,680 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,378 software developers and data experts.

Disable keys, like Home and End, in the KeyDown event of the Form

BD
Hi,

I have a control derived from BindingSource with a property of type
Form that contain the form that owns my control. I set that property
form.KeyPreview=true. I intercept the keys I want to disable, like
Home and End, and I set the e.Handled=true but that keys are always
executed. I think that overriding the ProcessCmdKey resolve my problem
but I don't want to make a component derived from Form to do only
that. What about other alternative do I have?

[]'s
BD
Mar 5 '07 #1
2 1471
You can make your form implement IMessageFilter and catch the keys in
the PreFilterMessage method. Here is a FAQ link on this.

http://www.syncfusion.com/faq/window...earch/905.aspx

==========================
Clay Burch
Syncfusion, Inc.
Mar 5 '07 #2
BD
On 5 Mar 2007 07:13:03 -0800, "ClayB" <cl***@syncfusion.comwrote:
>You can make your form implement IMessageFilter and catch the keys in
the PreFilterMessage method. Here is a FAQ link on this.

http://www.syncfusion.com/faq/window...earch/905.aspx

==========================
Clay Burch
Syncfusion, Inc.

Hi,

You'll notice that no matter what form or control has input focus, the
keys is caught in the PreFilterMessage override.
I only want to caught the keys in the active form with the code
handled in my control using the property of type Form. It's that
possible?

[]'s
BD
Mar 5 '07 #3

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

Similar topics

2
by: PAUL GROSSMAN | last post by:
Hello everyone. I am working with a DataGrid using VB .Net (Windows Forms). I want to make one of the columns un-editable. I was able to do that by setting the ...
5
by: Flip | last post by:
I'm trying to create a form which a user can type out a key, and the CTRL-ALT-SHIFT keys are recognized (via ModifiedKeys object) and then pass the letter the user pressed to the windows API method...
2
by: Phil Galey | last post by:
I have a Panel control docked on all sides on a form and the panel control contains a PictureBox. I'm using the KeyDown event of the form to respond to the and keys for resizing the image and the...
5
by: Rob | last post by:
If I use the following code: Private Sub Form1_KeyDown(ByVal sender As Object, _ ByVal e As System.Windows.Forms.KeyEventArgs) _ Handles MyBase.KeyDown Dim myKey As Integer myKey =...
3
by: brianbasquille | last post by:
Hello all, Simple enough question here, i think! I have a form which i want to work exclusively with the mouse but pressing up and down gives focus to two buttons which i have on the form? ...
3
by: MLM450 | last post by:
I have a control that handles the KeyDown event but it does not seem to execute when a combination of keys is pressed - like CTRL+Z. If I press CTRL, it executes. If I press Z, it executes. But the...
0
by: BD | last post by:
Hi, I have a control derived from BindingSource with a property of type Form that contain the form that owns my control. I set that property form.KeyPreview=true. I intercept the keys I want to...
2
by: Charles Law | last post by:
I'll kick myself when you tell me, but ... I have a user control on a form, and I want the user control to see the arrow keys when I press them. If I press just about any other key the control's...
9
by: Wingot | last post by:
Hey, I am using Visual Studio 2008 Beta 2 for some application development in C#, but I presume that the following question applies equally well to any environment.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.