Home > Excel Tutorial > Right-Click Context Menu On Userform’s Textbox

Right-Click Context Menu On Userform’s Textbox

Menu in sample is created with class module as a popup commandbar.The menu can be activated from the MouseUp event of the textbox.

These operations can be performed with the right-click menu :

-Copy

-Paste

-Clear

Private Sub CreateBar()
    Set cmdBar = Application.CommandBars.Add(, msoBarPopup, 0, 1)
    Set cmdCopyButton = cmdBar.Controls.Add(, 19)
    Set cmdPasteButton = cmdBar.Controls.Add(, 22)
    Set cmdClearButton = cmdBar.Controls.Add(, 47)
End Sub

 

textbox right click context menu

Example file can be downloaded here

 

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: