DIAdem Help

Content Type
Programming Language
Current manual
Table of Contents

Event: EventClpCopy for XTable

Event: EventClpCopy for XTable

Triggers in user dialog boxes when <Ctrl-C> is pressed in the extended table.

Use the TextToClipboard command to transfer a text to the clipboard. Use the TextFromClipboard command to read the text from the clipboard.

EventClpCopy(ByRef This)
ThisObject that triggers this event.

The following example displays the names and the values of channels in the extended table XTable1, which consists of input fields. If the user presses <Ctrl-C> in a cell of the extended table, the example copies the contents of the cell to the clipboard:

Sub XTable1_EventValGet(ByRef This, Row, Col, ByRef Cell, IsInputCell)
  If Row = 0 Then
    If Col <> 0 Then
      Cell.Text = Data.Root.ActiveChannelGroup.Channels(Col).Name
    Else
      Cell.Text = ""
    End If
  Else
    Select Case Col
    Case 0
      Cell.Text = Row
    Case Else
      Cell.Text = Str(Data.Root.ActiveChannelGroup.Channels(Col).Values(Row))
    End Select 
  End If
End Sub

Sub XTable1_EventClpCopy(ByRef This)
  Dim sCellValue
  sCellValue = Data.Root.ActiveChannelGroup.Channels.Values(This.ActiveCellRow)
  Call TextToClipboard(sCellValue)
End Sub

Sub XTable1_EventClpPaste(ByRef This)
  Dim oMyChannel
  Set oMyChannel = Data.Root.ActiveChannelGroup.Channels(This.ActiveCellCol)
  If oMyChannel.DataType = DataTypeChnString Then
    oMyChannel.Values(This.ActiveCellRow) = TextFromClipBoard
  ElseIf Isnumeric(TextFromClipBoard) Then
    oMyChannel.Values(This.ActiveCellRow) = CDbl(TextFromClipBoard)
  End If
  Call This.RefreshRows(This.ActiveCellRow,This.ActiveCellRow)
End Sub
In This Section
Was this information helpful?