Paste VFP top-level form skills
Source: http://huanqiu.51.net/vfp/29.htm
When you set the form to the top form and run in Windows independently, you will find that the replication paste function in the form is invalid, which causes great inconvenience to actual work, so that the prepared software does not meet the professional level.
The author believes that the reason for this problem is that when Microsoft is designed VFP, only consider the replication and paste of the form under the system menu, that is, the form under the system menu can use copy and paste hot keys, which is in Windows. The form is completely separated from the control of the system menu, so the copying and attachment of the hotkey fail. The solution is to prepare the following event handler to KeyPress Event, which first copy the selection content to the Windows clipboard, then copy the selection content to the Windows clipboard before copying the contents of the clipboard first. Add to the control.
KeyPress Event
LParameters nkeycode, nshiftaltctrl
IF nkeycode = 3
&& Ctrl C replication
-Cliptext = this.seltext
ENDIF
IF nkeycode = 22
&& "Ctrl V" paste
Do Case
Case this.selstart = 0
this.Value = -cliptext this.value
Case this.selstart> = 1 and this.selstart <= le (this.value)
THIS.VALUE = SUBS (this.Value, 1, this.selstart)
-Cliptext SUBS (this.Value, this.selstart 1)
Endcase
ENDIF
thisform.grid1.column1.setfocus ()
SELE recent
IF not EOF ()
Skip
ENDIF
thisform.refresh