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

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 1868
private void grdList_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)

{

e.Handled = true;

}

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

"julio" <gi****@cantoberon.it> wrote in message
news:OE**************@tk2msftngp13.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
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...
11
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...
1
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...
2
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
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...
10
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...
1
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...
0
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
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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...
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...

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.