GetSelectedEvent

ITcEventView

This method returns the index of the selected Event. The selection is done by by a left  mouse button click on the event item in the list view or by the method SelectEvent.

HRESULT GetSelectedEvent([out,retval] long* pSelEvent);

Parameters

pSelEvent

[out, retval] A pointer to variable that receives the index of the selected event. The index in the list view starts at the top with the index 0.

Return Values

S_OK

Function was successfully called

E_POINTER

pSelEvent was no valid pointer

Visual Basic sample code

Option Explicit

' add the Beckhoff TcEvent View Library to the components
' place a TcEventView on the form, and assign the name TcEventView1
' place a command button on the form, and assign the name Command1

Private Sub Command1_Click()
  ' get the selected event
  Dim index As Long
  index = TcEventView1.GetSelectedEvent()

  ' reset the event
  Call TcEventView1.ResetEvent(index)
End Sub

Remarks