Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 29 of 29

Thread: right click context menu for textbox

  1. #21
    VBAX Mentor
    Joined
    Dec 2008
    Posts
    404
    Location
    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

    Artik
    Attached Files Attached Files

  2. #22
    VBAX Regular
    Joined
    Mar 2020
    Posts
    79
    Location
    Thanks I will take a look tomorrow.

  3. #23
    VBAX Regular
    Joined
    Mar 2020
    Posts
    79
    Location
    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.

  4. #24
    VBAX Regular
    Joined
    Mar 2020
    Posts
    79
    Location
    I just shared this macro with one using 64bit Word and it objects.
    PtrSafe attribute required.
    Where and how do I do this?

  5. #25
    VBAX Mentor
    Joined
    Dec 2008
    Posts
    404
    Location
    Sorry, I will not convert to 64-bit version. I feel too weak.

    Artik

  6. #26
    VBAX Regular
    Joined
    Mar 2020
    Posts
    79
    Location
    Sorry about that.

    Can anyone else help please.?

  7. #27
    VBAX Regular
    Joined
    Mar 2020
    Posts
    79
    Location
    Can someone with a 64bit Word try this file to see if it loads without objections.
    Attached Files Attached Files

  8. #28
    VBAX Mentor
    Joined
    Dec 2008
    Posts
    404
    Location
    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.

    Artik
    Last edited by Artik; 04-01-2020 at 02:47 AM.

  9. #29
    VBAX Regular
    Joined
    Mar 2020
    Posts
    79
    Location
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •