VB 6.0 - Datagrid MouseWheel scrolling - Asked By Dan Moore on 28-Apr-09 05:43 PM

I cannot scroll data in a datagrid using the mousewheel. To help resolve my issue, I created a very simple VB6 application. On an empty form I added one ADO Data Control and one Datagrid. I created a Connection string in the ADODC to point to an Access database using MS Jet OLEDB.4.0. The RecordSource is sent to 8-adCmdUnknown and the Command Text is "Select * From Materials" (Materials is a table in the database with over 100 records).

I then set the Datagrid's DataSource property to the ADODC described above and retrieved the fields. The form does not have any code what-so-ever.

I run the app from VB6 and the form appears with the ADODC and the Datagrid displayed. The grid is successfully loaded with entries from the database.

With the form displayed on the left side of my screen and the empty code panel displayed in VB on the right, I move the mouse over the grid and roll the wheel. Nothing happens. I then move the mouse to the empty code panel in VB and click once then move the mouse over the datagrid again and the mouse will now scroll the entries with the mouse wheel (as I expected it to).

What is happening here? Why can't I scroll data in the datagrid without clicking somewhere in the VB window first? Once I click anywhere on the application's form, scrolling stops working.  

I have search the Internet for info on this issue and find lots of places where it says mousewheel scrolling is supported in the Microsoft Datagrid.

Santhosh N replied to Dan Moore on 28-Apr-09 10:25 PM
You could fins some info on this with a suggestions..

http://www.tek-tips.com/viewthread.cfm?qid=701611

Datagrid MouseWheel scrolling - Dan Moore replied to Santhosh N on 29-Apr-09 01:20 PM

Thank you for the quick update. I have checked everything on 701611 with no success. As a further test, I generated an executable module of this test program and shut Visual Basic down. I executed the program and could not get the data to scroll. I then started VB up with a completely different program and clicked once in the code section of a module. I then moved the mouse to the test program window and the data began to scroll successfully. As soon as I click in the test program window, scrolling stops working. What is it about clicking in VB that activates scrolling in another window? Could it be the "MouseWheel Fix" Add-In I placed in VB to get scrolling to work in VB? If so, how do I put it into my program?