• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 551
  • Last Modified:

Subclassing in VB6


I am trying to use subclassing in a VB6 app to enable the scroll wheel of the mouse.  Apart from the usaul horrors about the IDE crashing etc - which i don't kow if anyone has a resolution for?  I have one form that has a flex grid that is editable by placing a text box over the selected cell and then entering a value, which is then placed in the flexgrid.  When i use the mouse wheel on this form nothing happens, i am guessing that i may have the order of the events firing wrong.  Has anyone come across this situation and if so how did they get round it?

Also if anyone knows a more stable way of using the Scroll Wheels in a VB6 application please get in touch.
  • 2
2 Solutions
1114goddersAuthor Commented:
Well got round the IDE crashing by using some boolean values to check if a form or submorm was sublassed and then check to see if we are in the IDE mode.  If so then unhook the offending form - so far so good.  Just the problem with the text box on the flex grid now.
hi there are sample codes that enables mouse wheel scrolling

for flex grid

for textbox

hope this helps
1114goddersAuthor Commented:
ee rlee

I actually have the scroll wheel functioning in the application, the problem was where i had a flex grid that was editable by means of placing a text box over a cell.

I have now solved this problem by placing the unhook at the start of the LeveCell event then hook the form at the end of the code after;

Private Sub G_LeaveCell()

If SUBCLASSED_SUB = True Then 'SUBCLASSED_SUB is a boolean value that states if the form is      subclassed or not
        'Unhook the form
 End If

    Some code here........

    'Hook the form again
    SubWheelHook Me

End Sub

Then on the scroll event of the grid set the focus on the grid if we scroll past a selected row.

voilà, scroll wheel on a Flex Grid that is editable....

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now