Creating right-click menus

G

Guest

I have an excel worksheet with multiple text boxes. I want to create a
right-click menu that will allow me to select "copy" or "paste", just like
you can do in MS Office apps. My idea (as I am not an accomplished VB
programmer) is to create a list box that is called on right mouse button
click. Where do I go from there?
Here is what I have so far...

Private Sub TextBox11_MouseDown(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)

If Button = 1 Then
Me.Label10.Visible = True
ElseIf Button = 2 Then
Me.ListBox1.Visible = True
Else: End If

End Sub

Private Sub TextBox11_MouseUp(ByVal fmButtonLeft As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)

Me.Label10.Visible = False

End Sub

Where...Label10 is just a tooltip, and TextBox1 is my box containing "Copy"
and "Paste". Also, can I make the listbox position variable based on cursor
position?
Thanks for any help.
 
G

Guest

I am also considering using a form instead of the listbox. The form would
have two control buttons. One would use the Clipboard.SetText function and
the other would use the Clipboard.GetText function. Does this sound viable?
 

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

Similar Threads

Textboxes and labels in Userform?? 5
Userform Question 1
UserForm Mouseover??? 1
2003 - MS Calendar Control VBA weirdness 4
automation error 0
Drag and Drop 1
Textbox and SpinControl - Class 8
UserForm ListBox 1

Top