Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Antonio Massouh
  Where is Antonio Massouh?
 Campinas
 Brazil
 Antonio Massouh
 To: Mike Gagnon
  Where is Mike Gagnon?
 Pointe Claire
 Canada
 Mike Gagnon
 Tags
Subject: RE: Context menu on a form
Thread ID: 228699 Message ID: 228703 # Views: 16 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: General VFP Topics
Date: Wednesday, May 20, 2009 11:57:09 PM         
   


> > Hello dear colleagues !
> >
> > I have a form with an Editbox on it. The Editbox is populated with some text.
> > When I run the application and the form appears on screen, I click the right mouse button on the EditBox and nothing happens. I would like to open the context menu when I right click the mouse button. How to do this ?
> >
> > Thanks
> >
> > Michel
>
> I am not sure what the problem. Is it the RightClick event of the EditBox, or the menu itself. Where do you have difficulty? Here is an exemple:
>
>
PUBLIC oform1
> 
> oform1=NEWOBJECT("form1")
> oform1.Show
> RETURN
> DEFINE CLASS form1 AS form
> 
> 
> 	DoCreate = .T.
> 	Caption = "Form1"
> 	Name = "Form1"
> 
> 
> 	ADD OBJECT edit1 AS editbox WITH ;
> 		Height = 217, ;
> 		Left = 36, ;
> 		Top = 12, ;
> 		Width = 301, ;
> 		Value = "Hello", ;
> 		Name = "Edit1"
> 
> 
> 	PROCEDURE edit1.RightClick
> 		DEFINE POPUP shortcut SHORTCUT RELATIVE FROM MROW(),MCOL()
> 		DEFINE BAR 1 OF shortcut PROMPT "test"
> 		ON BAR 1 OF shortcut ACTIVATE POPUP test
> 
> 		DEFINE POPUP test SHORTCUT RELATIVE
> 		DEFINE BAR 1 OF test PROMPT "test1"
> 		DEFINE BAR 2 OF test PROMPT "\-"
> 		DEFINE BAR 3 OF test PROMPT "test2"
> 
> 		ACTIVATE POPUP shortcut
> 	ENDPROC
> 
> 
> ENDDEFINE

>
>
>
> Mike Gagnon
> Refox XI +(English version)


Hi Mike !
Yes, it worked. I just put the code between "PROCEDURE edit1.RightClick" and "ENDPROC" you provided above inside the RightClick Event of the Editbox.
But I want to give the user 3 options in the context menu: Select all text, Copy (or Select and copy all text in just one click) and Print. What are the commands I have to write to fire selection, copy and print ?
Thank you,
Michel

ENTIRE THREAD

Context menu on a form Posted by Antonio Massouh @ 5/20/2009 11:18:35 PM
RE: Context menu on a form Posted by Pete Sass @ 5/20/2009 11:43:52 PM
RE: Context menu on a form Posted by Antonio Massouh @ 5/21/2009 12:01:44 AM
RE: Context menu on a form Posted by John Terburg @ 5/25/2009 2:03:45 PM
RE: Context menu on a form Posted by Mike Gagnon @ 5/20/2009 11:45:15 PM
RE: Context menu on a form Posted by Antonio Massouh @ 5/20/2009 11:57:09 PM
RE: Context menu on a form Posted by Stefan Wuebbe @ 5/21/2009 9:41:32 AM
RE: Context menu on a form Posted by Antonio Massouh @ 5/22/2009 2:33:30 AM
RE: Context menu on a form Posted by Yousfi Benameur @ 5/21/2009 1:35:45 AM
RE: Context menu on a form Posted by Antonio Massouh @ 5/22/2009 2:44:42 AM
RE: Context menu on a form Posted by Yousfi Benameur @ 5/22/2009 10:47:18 AM
RE: Context menu on a form Posted by Antonio Massouh @ 5/22/2009 4:17:21 PM
RE: Context menu on a form Posted by Yousfi Benameur @ 5/22/2009 6:10:40 PM
RE: Context menu on a form Posted by Antonio Massouh @ 5/23/2009 2:12:02 AM
RE: Context menu on a form Posted by Yousfi Benameur @ 3/22/2011 10:59:42 AM