We need to slightly change the approach to the problem. Instead of looking for which control is active, explicitly point it and pass it as an argument to ShowPopup and EnableMenuItems.
Procedures that have changed:
ShowPopup
EnableMenuItems
TextBox1_MouseDown
TextBox2_MouseDown
TextBox3_MouseDown
This is excellent work I am sure. Works perfectly in any place I have the code specific for that box.
Thank you for your time and effort, knowledge on this. It really had frustrated me that ones were saying it worked but I could not get it to work. I had no idea initially that frames would be of any issue to the other code. Hopefully your code will get a good distribution. I think it should be renamed to set it apart from the other module. I will put a link in mine to this post.
This is unlikely to work. The 64-bit conversion is not a simple conversion of Long to LongPtr. Part of the API parameter declarations are still Long. But some of the variable declarations used in the procedures below must also change.
Read: https://docs.microsoft.com/en-us/pre...ectedfrom=MSDN
and download the Win32API_PtrSafe.TXT file.
You must also use conditional compilation to get a file that will work on both 32-bit and 64-bit versions.
Thanks I had looked at that page and the best I could do was what I posted. Someone with the knowledge and time can surely make this work on 32 and 64 and we will all benefit from being able to have right click menu in any place on VBA Forms. I am ok as I have 32 bit, but I would like 64 bit users to be able to use it so they can use my macro form with menu.