473,698 Members | 2,556 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

listbox wont scroll with the mouse wheel

3 New Member
Hi, i need to use a owner draw listbox(i am using windows forms in NET 2.0 ). I created a testlistbox ,implemented the DrawItem method and it works fine, it scrolls with the mouse wheel. After that i created the same kind of listbox but i added more complex code in DrawItem and my listbox wont scroll with the mouse whell or with the arrows keys, i have to use the scrool bar. I search but i can't find the answer why in first case it works and in the second case it does not works. Please help me. Thx.
Oct 15 '08 #1
4 2738
Plater
7,872 Recognized Expert Expert
Could you post the working version and none working version?
Generally it is best if you start with one and go piece by piece until you reach the other, that way you can see what code causes the failure of scrolling.
Oct 15 '08 #2
joedeene
583 Contributor
Generally it is best if you start with one and go piece by piece until you reach the other, that way you can see what code causes the failure of scrolling.
A.K.A. Troubleshooting :D

joedeene
Oct 15 '08 #3
simion314
3 New Member
my list box is ownerdraw so first i remove the code in the draw method, nothing. Surprise if i remove the code in the Seected index it works :

the code is:

this.listView1. Items[this.listBox1.S electedIndex].Selected = true;
this.listView1. Select();

i have the listbox and the listview and i syncronise them if you select a item in first the coresponding item is selected in second and if you select in second (the list view then the coresponding item in the listbox is selected.
I have no ideea why this code breakes mouse wheel scroling, if it break all scroling then it was something wrong with it but only mouse and keyboard scrolling....?? ???
i need help to solve this puzzle
Oct 15 '08 #4
simion314
3 New Member
i fixed but i still do not understend why the mouse wheel do not worked. The fix was adding a check
if (listView1.Item s[listBox1.Select edIndex].Selected) return;
so if the item is already selected i stop preventing the item to be reselected that will select again the item in my listbox. I placed break points and i do not found any circular calling betwen this controls, but something like that happend
Oct 15 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

12
12735
by: Arlie Rahn | last post by:
I would like to ad a custom scroll bar control to my app that has a customizable and "flat" look to it (not the normal VB look). Does anyone have any ideas on where to find a good one?
3
3985
by: Devonish | last post by:
I have a form designed as a Continuous form which displays one record per line. Taking account of the header and footer and the size of the screen, I can display 30 records at a time. I can see other records by scrolling up or down with either the scroll bar on the right of the screen, or the up and down arrows which are above and below this scroll bar; or I can use the scroll wheel
1
4039
by: Otie | last post by:
Can this be fixed? I have a combo box which is filled with lots of choices on a certain form. I click on the combo box and want to scroll down through the items using my mouse's scroll wheel. But instead of scrolling through the combo box, Access 2000 starts scrolling through the records, as if I was hitting PAGE DOWN. How can I get Access 2000 to use the scroll wheel to scroll the combo box rather than go to the next record(s). The...
1
3101
by: Marcin | last post by:
Im using MS Access 2000. i have a main form and ona subform that is scrolled vertically. unfortunately i use mouse scroll to scroll this subform. I appreciate your help
1
6870
by: Keltus | last post by:
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...
1
10927
by: Code Monkey | last post by:
using VS2005 and c# to create a windows forms application. One of my forms has a panel which I've added various controls to. Now, I've set the autoscroll property to true, which is great, but I can't use my mousewheel to scroll up or down and its annoying the hell out me. How do I get a panel to scroll on mousewheel scroll event? Hope someone can help.
14
13804
by: effendi | last post by:
Is it possible for me to disable the wheel scroll in a mouse when user click on a drop-down list? Thanks
1
3206
by: kallol | last post by:
I have a simple HTML page where I have a form with in a <div style="height: 600px; width: 100%; overflow: auto;">. The mentioned div styles are mandatory to get the expected behavior of the div. Now, in Firefox, the page appears properly as expected. I can scroll down and up the div part by dragging the scroll bar by mouse and I can scroll down and up the div part by rolling up and down the mouse wheel as well. But I am facing the problem...
1
2413
by: Paul Brady | last post by:
First, apologies iif this is an old problem. I do read this group, but I may have missed it. When I open a form in A2K to put data into a record (or create a new record), all is well provided I do not touch the wheel on top of the mouse. I can do anything else with the mouse, that is, move it around the form and click on controls. But if I turn the wheel, Access closes out the current form record and begins to scroll up or down thru...
0
8683
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
8609
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
9170
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
8901
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
8871
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6528
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
5862
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
3052
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
2336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.