UserForm - Right-click a Textbox and Paste

P

PCLIVE

In a UserForm TextBox, is there a way to allow right-clicking? For example,
I'd like to be able to right-click inside of a textbox and get the menu
option to Paste. I know I can use Ctrl+v, but I'd like to know if it can be
done completely from the mouse.

Thanks,
Paul

--
 
J

Jim Rech

The problem seems to be that userform textboxes do not have context menus in
run mode, and userforms do not support menus of any sort in run mode.

If you want a right click on a text box to do a paste without benefit of a
menu it could be as simple as:

Private Sub TextBox1_MouseUp(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
If Button = 2 Then ''Right mouse button
SendKeys "^v"
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top