FT View SE V10- VBA Mouse Button code works only on Button 1 not Button 2

Tanquen

Member
Join Date
Jul 2014
Location
CA
Posts
163
I have some code that is working but only if linked to mouse button 1 and I really need it to be a button 2 or right mouse click function. The code is on the MouseUp sub and is used to move an object on screen. I’m sure it’s just a quirk of VBA but thought there may be a workaround.

Mouse button 2 will work but only if released over the same object as when clicked, mouse button 1 don't care where on the screen the release happens.

Private Sub Box1_MouseUp(ByVal Button As DisplayClientEx.gfxMouseButtonConstants, ByVal Shift As Integer, ByVal X As Long, ByVal Y As Long)
Dim XObject As Object
Dim YObject As Object

FindNumStart = InStrRev(Box1.ToolTipText, "[") + 1
FindNumEnd = InStrRev(Box1.ToolTipText, "]")
BoxNum = Mid(Box1.ToolTipText, FindNumStart, (FindNumEnd - FindNumStart))
Set XObject = ThisDisplay.FindElement("XW" & BoxNum)
Set YObject = ThisDisplay.FindElement("YW" & BoxNum)

PNum = Box1.ToolTipText & ", " & Chr(34) & Mid(Box1.ToolTipText, 1, (FindNumStart - 14)) & "BoxPosition[" & BoxNum & Chr(34)
If Button = 2 Then
GetCursorPos Mouse
ScreenToClient Me.Application.WindowHandle, Mouse
Box1.Left = Mouse.X - 40
Box1.Top = Mouse.Y - 78
XObject.Value = Box1.Left
XObject.Download
YObject.Value = Box1.Top
YObject.Download
ElseIf Button = 1 Then
GetCursorPos Mouse
ExecuteCommand Cmd & " /X" & Box1.Left - 68 & " /Y" & Box1.Top + 100 & " /T " & PNum
End If

End Sub
 

Similar Topics

I'm trying to write to an objects .Value based on a different value for the objects number. So if the object number is 1 then...
Replies
4
Views
3,520
Anyone know how to change the mouse icon to something else using VBA? It looks like it can be done with VBA forms and based on the object the...
Replies
0
Views
2,202
Is there a way to set a clicked object to have focus. I'm trying to open a popup next to where I clicked and "Display popup /RP /T" with the...
Replies
1
Views
2,340
Hey all, First post! I am trying to embed a web browser into my application to enable us to watch live feed of our AXIS IP Camera. The problem is...
Replies
0
Views
907
I have a FT View ME project that we need to make a simple change to and all we have is the .mer file. I tried to restore it with the application...
Replies
1
Views
1,059
Back
Top Bottom