473,785 Members | 2,568 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

removing default spacebar behaviour form listboxes ( and buttons)

I noticed that pressing spacebar when a listbox has the focus scrolls
the listbox to the first selected item.

I'm intercepting the spacebar press event at form level for stopping and
starting audio playback, so I would like to remove the default behaviour
form the listbox, and also from other buttons and controls.

I tryed ( following a tutorial ) to subclass the listbox class, but I
was able to intercept only mouseclicks, not the keydown event (I
imagined that is the keydown event I must intercept and don't pass for
further processing)

any idea?

Tnanks

Jul 21 '05 #1
1 1897
private void grdList_KeyDown (object sender,
System.Windows. Forms.KeyEventA rgs e)

{

e.Handled = true;

}

this line stops any event from further processing .. try..

"julio" <gi****@cantobe ron.it> wrote in message
news:OE******** ******@tk2msftn gp13.phx.gbl...
I noticed that pressing spacebar when a listbox has the focus scrolls
the listbox to the first selected item.

I'm intercepting the spacebar press event at form level for stopping and
starting audio playback, so I would like to remove the default behaviour
form the listbox, and also from other buttons and controls.

I tryed ( following a tutorial ) to subclass the listbox class, but I
was able to intercept only mouseclicks, not the keydown event (I
imagined that is the keydown event I must intercept and don't pass for
further processing)

any idea?

Tnanks

Jul 21 '05 #2

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

Similar topics

3
1990
by: GlennH | last post by:
Hi folks, I want to use the default behaviour of a browser to display xml in an open / close block style. E.g. you can show or hide the sub elements of an element. But.... The default behaviour also shows all elements expanded, I want to open the xml file and see all elements closed. Is this possible?
11
1596
by: kiran | last post by:
I am trying to implement a rubber band/image selection script. For that I need to remove the default drag behaviour on an image. I am able to do this in IE but not Netscape. Does any one have a solution? Pls look below for IE code: var moz = ((document.all)? false : true); var ie = ((document.all)? true : false); var ElementUtil = new Object(); ElementUtil.addEventListener = function(o, type, handler) {
1
1560
by: kiran | last post by:
I am trying to implement a rubber band/image selection script. For that I need to remove the default drag behaviour on an image. I am able to do this in IE but not Netscape. Does any one have a solution? Pls look below for IE code: var moz = ((document.all)? false : true); var ie = ((document.all)? true : false); var ElementUtil = new Object(); ElementUtil.addEventListener = function(o, type, handler) {
2
1610
by: Poko | last post by:
Hi all Was wondering if someone could show me how I can use javascript to submit a form using three separate buttons that would cause the forms action="" to hold different values? Poko
2
1596
by: Bratislav Jevtic | last post by:
hi, how to make some push button default on the form? for instance, I've got 2 buttons (Submit, Cancel). submit is on the left, cancel on the right side. on enter key pressed, cancel button is processed - wrong. so, how to make a button default (when one presses ENTER then it's processed onClick event)? thanks, bj
10
9051
by: Jane Sharpe | last post by:
Hi, I have a textbox with the words "Enter your name here" inserted as default text - At the moment, to remove this the user must highlight all the text and delete before they type in their name - I've seen sites where all this text dissapears as soon as the user clicks on it - how do I do that ? Thanks Jane
1
284
by: julio | last post by:
I noticed that pressing spacebar when a listbox has the focus scrolls the listbox to the first selected item. I'm intercepting the spacebar press event at form level for stopping and starting audio playback, so I would like to remove the default behaviour form the listbox, and also from other buttons and controls. I tryed ( following a tutorial ) to subclass the listbox class, but I was able to intercept only mouseclicks, not the...
0
1150
by: Mark 123 | last post by:
For those of you that are using the Access 2007 Beta, can I ask, comparing Access 97: Are form command buttons the new XP format with Hot/Cold mouse over functionality?
2
1096
by: =?Utf-8?B?c3Zlbg==?= | last post by:
Hi, what would be the default strtok behaviour when a null string is passed into the string parameter in the first call to strtok? I would expect a null pointer to be returned but it is sometimes causing my program to crash. Thanks.
0
9481
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10341
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...
1
10095
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
8979
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
7502
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
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4054
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
2
3656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2881
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.