473,399 Members | 3,919 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,399 software developers and data experts.

scroll a listbox

Hello,

I have a Form with a ListBox in it. I'd like to be able to scroll the
ListBox even when it's not in focus. ie. when i scroll the mousewheel
when my focus is on the form, I'd like the ListBox to scroll. Now,
there are two ways I would think would work. The first is if I can
resend the MouseEventArgs to the ListBox but there does not seen to be
a way to pass that event along. The second is if I could manually
scroll the ListBox when the Form sees the MouseEventArgs. I gues that
would require something like mylistbox.Scroll(e.Delta *
WindowsScrollMultiplier); but unfortunately, there is no Scroll()
member function for ListBox. So I seem to be stuck.

Thanks,
Nov 15 '05 #1
1 6846
the list box can't scroll unless it has focus.
however, you can capture the wheel event on the body and set focus to the
list box like,
<body onmousewheel="document.all.listboxid.focus();">

then whenever you are on the page, if you scroll with the mouse, the list
box will be given focus and the scrolling is possible.

"Keltus" <pu**********@yahoo.com> wrote in message
news:b1**************************@posting.google.c om...
Hello,

I have a Form with a ListBox in it. I'd like to be able to scroll the
ListBox even when it's not in focus. ie. when i scroll the mousewheel
when my focus is on the form, I'd like the ListBox to scroll. Now,
there are two ways I would think would work. The first is if I can
resend the MouseEventArgs to the ListBox but there does not seen to be
a way to pass that event along. The second is if I could manually
scroll the ListBox when the Form sees the MouseEventArgs. I gues that
would require something like mylistbox.Scroll(e.Delta *
WindowsScrollMultiplier); but unfortunately, there is no Scroll()
member function for ListBox. So I seem to be stuck.

Thanks,

Nov 15 '05 #2

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

Similar topics

4
by: Filips Benoit | last post by:
Dear All, I have code that selects - find and select - 1 item in a large listbox. This works Ok but most of the time the selected item isn't visible without scrolling down manualy. Is this...
12
by: Jim H | last post by:
I have a ListBox hold a list of my custom controls (it's UserControl based control with a couple radio buttons and a checkbox). Everything works and displays the way I expected it to. I can move...
6
by: Adam Klobukowski | last post by:
Hello. /windows forms/ I'm marking listbox items as selected, and I'd like to scroll listbox to a selected entry if it is off-screen. How can I do it? -- Semper Fidelis Adam Klobukowski
2
by: Tina | last post by:
Am I missing something or does the listbox web control not have a horizontal scroll capability? Thanks, T
3
by: Vidds | last post by:
Hi Everyone, How come Server listbox control does not have a Horizontal Scroll Property? If any one has an idea how we add a Horizontal scroll to a listbox or dropdown list box it would be quite...
2
by: John | last post by:
Hi, I'm currently working on a simple project (for study on C#) with an input (maskedtextbox) and a listbox. The input numbers are send in the listbox. When the listbox is filled with numbers...
1
by: Roscoe | last post by:
Hi, my first post here. I am running Access2000 SP3 under XP Pro SP2 and I have a Logitech MX 3000 cordless mouse. My problem is that the mousewheel will not scroll in a listbox. It will scroll...
0
by: R.Nijkamp | last post by:
Hello, i was wondering if its an limitation of IE when a asp.net listbox is set disabled, then a user wont be able to scroll inside the listbox. While the user can scroll inside the listbox when...
7
by: Lit | last post by:
Hi, How can I capture the vertical scroll bar position for a Listbox. I have a Listbox of 100 items + when I click on it I post back remove the item selected. After returning to the client...
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
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,...
0
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...
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.