Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: Chip on November 19, 2007, 03:52:39 PM

Title: Mouse button push-on & release-off, For an Output# in Mach button
Post by: Chip on November 19, 2007, 03:52:39 PM
Hi, All

My VB skill's are very bad, Could someone post some VB code for a Mouse button push-on, release-off for an Output#.

Like the MPG Jog Arrows, Searched all over for something simple and concise.

The code below only allows a Click on and Click off

If IsOutputActive( OUTPUT17 ) Then
   DeActivateSignal( OUTPUT17 )
Else
   ActivateSignal( OUTPUT17 )
End If   

Just Lost Hear Thanks, Chip
Title: Re: Mouse button push-on & release-off, For an Output# in Mach button
Post by: Ron Ginger on November 20, 2007, 07:49:41 PM
I dont think VB can read the mouse directly. Of course, a button can bbe set up so that when the mouse clicks on it that button will be 'pressed' and some VB code in the button can then run.

If thats what you want all you need is a button on the screen, set it to be a VB button in screen 4, then put the code you have in the button script form the Mach operator menu.

Title: Re: Mouse button push-on & release-off, For an Output# in Mach button
Post by: Chip on November 20, 2007, 09:46:28 PM
Hi, Ron

Thanks for the reply, Using this in a button and a brain for 45 deg jog function, Was hopping there was some VB code for the push-on, release-off out there.

Found allot of ways with Cilck-Click, 45 Brain, Nothing fancy,  http://www.machsupport.com/forum/index.php/topic,4897.0.html

Thanks, Chip