ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   UserForm - Right-click a Textbox and Paste (https://www.excelbanter.com/excel-programming/409490-userform-right-click-textbox-paste.html)

PCLIVE

UserForm - Right-click a Textbox and Paste
 
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

--




Jim Rech[_2_]

UserForm - Right-click a Textbox and Paste
 
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


--
Jim
"PCLIVE" wrote in message
...
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

--







All times are GMT +1. The time now is 02:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com