Event: EventClpCopy for XTable
- Updated2024-09-12
- 2 minute(s) read
User dialog boxes > Events > 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)
This | Object 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
Procedures
Checking a User Dialog Box Entry | Creating a Dynamic User Dialog Box | Creating a Procedure in the Script of a User Dialog Box | Creating a User Dialog Box without Linking Variables | Creating an Extended Table | Displaying Graphics in Selection Lists | Enabling Controls | Opening the Dialog Editor | Responding to User Entries in User Dialog Boxes | Saving and Restoring the Last Dialog Box Position | Saving Control Groups for User Dialog Boxes | Specifying the Default Button | Tabulator Order in a User Dialog Box | Using a Script to Fill a Selection List | Using Channel Selection Lists | Using Hotkeys in a User Dialog Box | Using the Flex Properties