Hi, I havn't tried this but it's an idea, If you put in each button ( Code "M111") and check the execute G-code, each button should run a macro called M111 (you can give the macro any number of your choice this is just an example) place the Macro in the Mach3 Macro folder and write your VB code in the macro.
Hope this works for you, let us know how you get on.