PC Review


Reply
Thread Tools Rate Thread

adding right click menu to textbox

 
 
=?Utf-8?B?15DXnNeZ?=
Guest
Posts: n/a
 
      2nd Jul 2007
Hi

I have assigned a "cell' menu to a textbox (in a userform) under the
dblclick event in order to copy and paste from and to the textbox. The
problem is that the pasted information is going to the active cell in the
worksheet instead of the userform's textbox.
Why there is no right click event for a textbox? and how can i paste the
information straight to the textbox?

Thanks in advance to your suggestion

Eli
 
Reply With Quote
 
 
 
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      2nd Jul 2007
> I have assigned a "cell' menu to a textbox (in a userform) under the
> dblclick event in order to copy and paste from and to the textbox. The
> problem is that the pasted information is going to the active cell in the
> worksheet instead of the userform's textbox.
> Why there is no right click event for a textbox? and how can i paste the
> information straight to the textbox?


While there is no "Right Click" event for a TextBox on a UserForm, you can
make use of the MouseDown or MouseUp events to see if the Right or Left
mouse buttons were pressed and put code in these tests to react to the
appropriate mouse button click. Here is a simple example to show this...

Private Sub TextBox1_MouseUp(ByVal Button As Integer, ByVal Shift As
Integer, _
ByVal X As Single, ByVal Y As Single)
If Button = xlSecondaryButton Then
MsgBox "RIGHT mouse button was pressed"
ElseIf Button = xlPrimaryButton Then
MsgBox "LEFT mouse button was pressed"
End If
End Sub


Rick

 
Reply With Quote
 
Michel Pierron
Guest
Posts: n/a
 
      2nd Jul 2007
Hi Eli,
An example here
http://cjoint.com/?hcqjbyrlKZ

Regards
MP

"???" <@discussions.microsoft.com> a écrit dans le message de news:
F08FA16D-1C7F-4DBB-909C-(E-Mail Removed)...
> Hi
>
> I have assigned a "cell' menu to a textbox (in a userform) under the
> dblclick event in order to copy and paste from and to the textbox. The
> problem is that the pasted information is going to the active cell in the
> worksheet instead of the userform's textbox.
> Why there is no right click event for a textbox? and how can i paste the
> information straight to the textbox?
>
> Thanks in advance to your suggestion
>
> Eli



 
Reply With Quote
 
=?Utf-8?B?15DXnNeZ?=
Guest
Posts: n/a
 
      3rd Jul 2007
Rick and Michel
Thanks for your help, it works like a dream.

Eli

"Michel Pierron" wrote:

> Hi Eli,
> An example here
> http://cjoint.com/?hcqjbyrlKZ
>
> Regards
> MP
>
> "???" <@discussions.microsoft.com> a écrit dans le message de news:
> F08FA16D-1C7F-4DBB-909C-(E-Mail Removed)...
> > Hi
> >
> > I have assigned a "cell' menu to a textbox (in a userform) under the
> > dblclick event in order to copy and paste from and to the textbox. The
> > problem is that the pasted information is going to the active cell in the
> > worksheet instead of the userform's textbox.
> > Why there is no right click event for a textbox? and how can i paste the
> > information straight to the textbox?
> >
> > Thanks in advance to your suggestion
> >
> > Eli

>
>
>

 
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
Adding Custom Menu Items to the Right-Click Menu Nathan Sokalski Windows XP Setup 1 3rd Feb 2005 04:41 AM
Adding Custom Menu Items to the Right-Click Menu Nathan Sokalski Windows XP Configuration 1 3rd Feb 2005 04:41 AM
Adding Custom Menu Items to the Right-Click Menu Nathan Sokalski Windows XP Performance 1 3rd Feb 2005 04:41 AM
Adding Custom Menu Items to the Right-Click Menu Nathan Sokalski Windows XP General 1 3rd Feb 2005 04:41 AM
Re: Adding a menu item right click menu when clicking on a single. Frank Kabel Microsoft Excel Programming 1 2nd Sep 2004 10:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:17 AM.