As a learning exercise (new to VB.Net) I'm looking to re-write an old VB6 database program in VB.NET which displays key cutting permutations for a locksmith. The display uses a number of textboxes which hold a number as well as being color coded. The old program is very keyboard intensive and I would like the user to to perform most of the tedious, repetitious functions using the mouse.

The ideal situation would be to set the focus on to a text box and using the left mouse click to toggle through numbers in accending order zero to nine incrementally (1 number for each click), the right button to toggle back in reverse order and use the mousewheel to toggle the textbox background through 3 sets of colors.

A lot of the detail of the program I can cope with, but I would appreciate some code assistance in capturing mouse clicks and mousewheel movements into a subroutine.
Can anyone help?

regards,

Tony C

You need the mouseclick event of the textbox. Then from the mouseevent args you can find out which button was pressed( e.button), left - right - or middle and call the method you want from there. You can also find the number of detents the wheel was rotated if it helps your scrolling (e.delta).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.