Example
The following example involves two Spread controls. The buttons allow the user to copy or cut from the first control and paste into the second control.
C++
void CTestDlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
m_Command1.SetWindowText("Copy");
m_Command2.SetWindowText("Cut");
m_Command3.SetWindowText("Paste");
}
void CTestDlg::OnButton1()
{
m_Spread1.ClipboardCopy();
}
void CTestDlg::OnButton2()
{
m_Spread1.ClipboardCut();
}
void CTestDlg::OnButton3()
{
m_Spread2.ClipboardPaste();
}
Visual Basic
Private Sub Form_Load()
Command1.Caption = "Copy"
Command2.Caption = "Cut"
Command3.Caption = "Paste"
End Sub
Private Sub Command1_Click()
fpSpread1.ClipboardCopy
fpSpread1.ClearSelection
End Sub
Private Sub Command2_Click()
fpSpread1.ClipboardCut
fpSpread1.ClearSelection
End Sub
Private Sub Command3_Click()
fpSpread2.ClipboardPaste
End Sub