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

Subclassing in VB6

Hi,

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.
0
1114godders
Asked:
1114godders
  • 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.
0
 
ee_rleeCommented:
hi there are sample codes that enables mouse wheel scrolling

for flex grid
http://planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=40122&lngWId=1

for textbox
http://planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=62681&lngWId=1

hope this helps
0
 
1114goddersAuthor Commented:
ee rlee

Hi,
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
        SubWheelUnHook
 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....
0

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