PC Review


Reply
Thread Tools Rate Thread

Creating right-click menus

 
 
=?Utf-8?B?SGFwcHlJblV0YWg=?=
Guest
Posts: n/a
 
      24th Oct 2006
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.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SGFwcHlJblV0YWg=?=
Guest
Posts: n/a
 
      25th Oct 2006
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?

"HappyInUtah" wrote:

> 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.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2003 - Menus and right click menus not appearing TMonay820 Microsoft Outlook Discussion 0 6th Feb 2010 09:28 PM
Right click menus =?Utf-8?B?R2FsbDE=?= Windows XP Customization 2 25th Apr 2005 06:12 PM
Sub-menus for Right Click add ins JRD Microsoft Excel Misc 2 24th Jan 2004 02:57 AM
Right click menus =?Utf-8?B?RGFuaWVs?= Windows XP Customization 2 12th Jan 2004 06:08 AM
Right-click menus beth Windows XP Internet Explorer 3 29th Dec 2003 09:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:32 AM.