473,609 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1616
Hi Mohammad,

Try overriding ProcessCmdKey on the Form

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

return base.ProcessCmd Key(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
2989
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 opened. However, if I keep the tool open, and open another window to do the screen capture, the tool will lose its focus, and the keydown event will not work anymore. I wonder if any of you can help me to solve this problem of how to get the focus...
4
34526
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 like the tab key, passing focus to the next control in the tab order. The only events that fire are in the lost focus sequence (leave, validating, validated, etc.) Any ideas?
3
9215
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 click on a row (withs will turn blue then) and then click on it again . Now if I press any key the event will fire (except for the arrow keys). I also tried to override the IsInputKey => no luck. I also tried to override the ProcessCmdKey => With...
4
8619
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 System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtRequestor.KeyDown If e.KeyCode = Keys.Enter Then SendKeys.Send("{TAB}")
5
2094
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 customer, did some changes, recompiled, zipped and sent it back to them, but then it screwed up. As a part of the debugging process, the ASP.NET has been set to run as SYSTEM, and all folders described in...
2
14640
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 hidden field with no luck. Here's what I'm doing function KeyDownHandler(btn) { if (event.keyCode == 13) {
2
4160
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 PageUp, PageDn, Home, End, and arrow keys for scrolling the Panel control. Resizing the image using the and keys works fine, deriving a resized thumbnail from the image and reassigning it to the Image property of the PictureBox. However I'm...
3
5244
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 handler does not see the combination. Now this control is contained within another control which is contained within another. The top most control does see the CTRL+Z. I can easily pass down the key info, but why does the nested control see...
2
2566
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 but no luck Do I have to go down to the level of capturing control keydown/press with time and then when enter key is pressed check the time? or is there some easier way?
0
8127
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8567
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8527
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8215
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6993
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5509
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2529
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.