ActiveReports 14 .NET Edition
GrapeCity.ActiveReports Assembly / GrapeCity.ActiveReports.SectionReportModel Namespace / RichTextBox Class / SelectedText Property
Example

In This Topic
    SelectedText Property
    In This Topic
    Gets or sets the current selected text in the control.
    Syntax
    'Declaration
     
    Public Property SelectedText As String
    public string SelectedText {get; set;}

    Property Value

    A string that represents the selected text in the control.
    Remarks
    To set this property, first set the SelectionStart and SelectionLength properties.
    Example
    private void detail_Format(object sender, System.EventArgs eArgs)
    {
        if (this.rtbActiveReport.Find("terrorizing") != -1)
        {
            this.rtbActiveReport.SelectionStart = this.rtbActiveReport.Find("terrorizing");
            this.rtbActiveReport.SelectionLength = 11;
            this.rtbActiveReport.SelectedText = "TERRORIZING";
            this.rtbActiveReport.SelectionColor = System.Drawing.Color.Crimson;
        }
    }
    Private Sub Detail1_Format(ByVal sender As Object, ByVal e As System.EventArgs) Handles Detail1.Format
        If Not Me.rtbActiveReport.Find("terrorizing") = -1 Then
            Me.rtbActiveReport.SelectionStart = Me.rtbActiveReport.Find("terrorizing")
            Me.rtbActiveReport.SelectionLength = 11
            Me.rtbActiveReport.SelectedText = "TERRORIZING"
            Me.rtbActiveReport.SelectionColor = System.Drawing.Color.Crimson
        End If
    End Sub
    See Also