Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trap Ctrl+C keystrokes
Message
From
18/01/2010 11:51:05
 
 
To
17/01/2010 11:32:28
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01444401
Message ID:
01444569
Views:
184
>Hi,
>
>Ctrl+C have inkey = 3 however (I supose) since these strokes are Windows defined for 'copy' the myForm.KeyPress method never acts on these keys, although myForm.Preview = .T.
>
>I still would like to have a method on myForm to be activated upon keystrokes Ctrl+C - does anyone have a solution for this?
>
>Regards,
>
>Koen

Why fight with VFP?

If you discard the _screen window,
and put your's form into a different top form ...
PUBLIC X
X=CREATEOBJECT("FORM1")
X.SHOW

DEFINE CLASS form1 AS form


	ShowWindow = 2
	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT text1 AS textbox WITH ;
		Height = 23, ;
		Left = 108, ;
		Top = 72, ;
		Width = 100, ;
		Name = "Text1"


	ADD OBJECT check1 AS checkbox WITH ;
		Top = 36, ;
		Left = 180, ;
		Height = 17, ;
		Width = 60, ;
		Alignment = 0, ;
		Caption = "Preview", ;
		ControlSource = "thisform.KeyPreview", ;
		Name = "Check1"


	PROCEDURE KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		IF nKeyCode=3 AND nShiftAltCtrl=2
			MESSAGEBOX("CTRL+C","FORM")
		ENDIF
	ENDPROC


	PROCEDURE text1.KeyPress
		LPARAMETERS nKeyCode, nShiftAltCtrl
		IF nKeyCode=3 AND nShiftAltCtrl=2
			MESSAGEBOX("CTRL+C","TEXTBOX")
		ENDIF
	ENDPROC


ENDDEFINE
Previous
Reply
Map
View

Click here to load this message in the networking platform