Share via


SearchEventArgs Class

Provides data for the Search event.

Namespace CrystalDecisions.Windows.Forms Assembly CrystalDecisions.Windows.Forms (CrystalDecisions.Windows.Forms.dll)

Syntax

'Declaration
Public Class SearchEventArgs
    Inherits ViewerEventArgs
public class SearchEventArgs : ViewerEventArgs

Remarks

The SearchEventArgs contains the data related to the Search event. The Search event is raised by the CrystalReportViewer control when text is searched for in the report.

Example

The following example gets the details of the Search event and creates a new entry in the event log.

'Declaration

      Private Sub LogSearchEvent(ByVal source As Object, _
         ByVal e As CrystalDecisions.Windows.Forms.SearchEventArgs) Handles _
           CrystalReportViewer.Search
         Dim eventLog As New EventLog("event.log")
         Dim eventMsg As String = _
         "Search event:" & vbCrLf & _
         "Direction: " & e.Direction().ToString & vbCrLf & _
         "PageNumberToBeginSearch: " & e.PageNumberToBeginSearch() & vbCrLf & _
         "TextToSearch: " & e.TextToSearch()
         eventLog.WriteEntry(eventMsg)
         e.Handled = False
      End Sub
      
      private void LogSearchEvent(Object source, 
      CrystalDecisions.Windows.Forms.SearchEventArgs e)
      {
         System.Diagnostics.EventLog eventLog = 
           new System.Diagnostics.EventLog("event.log");
         string eventMsg =
           "Search event:" + "\n" +
           "Direction: " + e.Direction + "\n" +
           "PageNumberToBeginSearch: " + e.PageNumberToBeginSearch + "\n" +
           "textToSearch: " + e.TextToSearch;
         eventLog.WriteEntry(eventMsg);
         e.Handled = false;
      }
      

Inheritance Hierarchy

Object
   EventArgs
      ViewerEventArgs
         SearchEventArgs

Version Information

Crystal Reports Basic for Visual Studio 2008

Supported since: Crystal Reports for Visual Studio .NET 2002

See Also

Reference

CrystalDecisions.Windows.Forms Namespace
CrystalDecisions.Windows.Forms.CrystalReportViewer