TreeView RightClick Trapping Backwards?

dgreen

Member
Local time
Yesterday, 23:59
Joined
Sep 30, 2018
Messages
397
See the screen capture below. The blue arrow shows where the mouse was when I right clicked. What should be happening is when I click on the node, what you see on the right visual should be happening. Conversely, when I click off the nodes, it should be showing what shows up on the left visual. What's happening is backwards.

I and the creator of this file have tested it on other computers and it behaves correctly elsewhere, without any changes.

The file is published to page 7 of the attached path. https://www.access-programmers.co.u...great-custom-class.309753/page-7#post-1676440

Thoughts on how else to troubleshoot this issue that appears to be a my computer issue?
Picture1.png
 
Any thoughts from the community on this behavior?
 
Is it a monitor resolution setting issue? I use a 4K monitor, and access does some strange stuff on it, and not on my other monitors.
Clutching at a straw or two I realise.
 
My main monitor is a 43" 4K 2160 pixels UHD. Just sliding the Access file to another monitor doesn't change the behavior.
 
Try closing it and reopening just on the "normal" monitor.

(My what a big monitor you have Grandma) :cool:
 
Disconnected the other monitors. Restarted the laptop. Using only the laptop. The resolution is 1366 x 768 (Recommended). Landscape. Opened the Access file with TreeView and the same issue persists.

Next idea please.

Try closing it and reopening just on the "normal" monitor.
 
I would reach out to @MajP I believe he wrote the original code.
Not sure what else it might be -some other API call or add in messing with it, although I think this version of the Treeview is purely VBA driven.
 
He's tracking my personal issue and we didn't figure out what my issue is on my end. It appears localized to me.
 
Have you tried an Office repair/reinstall of Access ??
 
Repair executed. No change. Still backwards. Click on the note does the Click off actions and vice versa for the other way.
 
I have no help to provide. The issue does not seem to be in any code, but in the action of the Active X control. It almost appears that it thinks the right click is occurring in a mirror image from where it is in the control. Since the code traps the position using HitTest the code fails because the position is wrong.
Did you test the mouse with a different mouse or touchpad? Maybe it is in the graphics card.
I have tested on two different computers one with Office 2010 and one with 2013, without issue.
 
Switched out the mouse and no difference.

I seems that on my computer the right click on node functions happen when I'm right of the below red line and the off node happens to the left of the red line.

The on node actions from the mouse click only action the top node.
1584389001411.png
 
I'm using Access 2019, so it might be a versioning issue. The drag and drop feature works. The buttons on the right work. It's just the fricking right click that isn't.
 
Here is the code for the right click event. Not that it would help, but I would be curious of the x position and if it is reversed some how. You can add the msgbox
Code:
Private Sub mTVW_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As stdole.OLE_XPOS_PIXELS, ByVal y As stdole.OLE_YPOS_PIXELS)
Dim NodeHit As Node
If Button = 2 Then

MsgBox "X: " & x & " Y: " & y

Set NodeHit = mTVW.HitTest(x, y)
If Not NodeHit Is Nothing Then
  RaiseEvent RightClickOnNode(Me.getNodePK(NodeHit))
Else
  RaiseEvent RightClickOffNode
End If
End If
End Sub
 
When I click on the L3 icon - X: 53 Y: 47.
When I click at the same line level but all the way to the right of the box X:717 Y:47.

Appears for me that the X: point where things change is at X=559.
 
The cursor knows that the top left is 0,0 and bottom right is 729,580.

I had another user with Office 2019 try it out and they have the same issue as I.

Maybe it's a focus issue? In the below screen capture, I clicked on the bottom record. I'm noticing a light dashed outline showing up on the top record.
1584391916346.png
 
What is your Windows screen scaling setting? 100%, 125%, or 150%?
 
Laptop 1366x768 @ 100% scale
Larger monitor 3840 x 2160 @ 125%.

Changed the scale but the same behavior persists. No improvements.

Next idea please?
 

Users who are viewing this thread

Back
Top Bottom