473,378 Members | 1,099 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.

KeyDown Message Capturing problem..

Hi,

I am working on vs2k5 IDE for C# development. I made one Form which
has one button on it. I tried to override KeyDown message on From but
KeyDown message received. if Form does not containing any Item. When I
drop any thing on Form, it does not receive KeyDowm message. I want to
change button location according to Arrow keys. Please guide me what I
do it?

Regards,

-aims

May 13 '07 #1
2 1598
Hi Mohammad,

Try overriding ProcessCmdKey on the Form

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
switch (keyData)
{
case Keys.Left:
break;
case Keys.Right:
break;
case Keys.Up:
break;
case Keys.Down:
break;
}

return base.ProcessCmdKey(ref msg, keyData);
}

On Sun, 13 May 2007 15:21:34 +0200, Mohammad Omer Nasir <mo******@gmail.comwrote:
Hi,

I am working on vs2k5 IDE for C# development. I made one Form which
has one button on it. I tried to override KeyDown message on From but
KeyDown message received. if Form does not containing any Item. When I
drop any thing on Form, it does not receive KeyDowm message. I want to
change button location according to Arrow keys. Please guide me what I
do it?

Regards,

-aims



--
Happy coding!
Morten Wennevik [C# MVP]
May 13 '07 #2

Hi Morten,

Thanks Morten Wennevik! :) Its working! :)

Regards,

-aims

May 14 '07 #3

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

Similar topics

0
by: mee-shell | last post by:
Hi, I am a python newbie. I have created a tool for capturing the screen shot. I want to be able to do the screen capture with the keydown event as well. The tool worked fine when it first...
4
by: Mike M | last post by:
I am trying to detect the keydown of the arrow keys in a custom control that I am writing. As far as I can tell, pressing the arrow keys does not fire the KeyDown event at all. It behaves just...
3
by: bardo | last post by:
I have a Datagrid that is inside a panel. I want to use the keyDown event to reconize the arrow keys. But I have no luck at all. The problem is that the keydown event won't fire at all, unless I...
4
by: Anne | last post by:
hie again, i have 3 textbox and i would like the user to go to the next textbox by pressing the 'ENTER' key. i have tried using this: Private Sub txtRequestor_KeyDown(ByVal sender As...
5
by: Kim Nørby Andersen | last post by:
Hello there I am lost. i receive the output in the bottom, from a site that runs excellently on our development server, but dies on the customer. We have had a first version running at the...
2
by: George Durzi | last post by:
I have a text box and a button, and I want the enter key to run the click event of the button. The textbox and button are inside a user control. I tried all sorts of stuff with the __EVENTTARGET...
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...
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...
2
by: GS | last post by:
I was trying to catch the control enter key sequence of a combo box in the keydown event, but I failed to se anything like control enter, neither Did I find in keypresssed event I tried google...
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
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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.