event SelChange ()
Occurs when the user selects text in the control.

 TypeDescription 
Use the SelChange event to notify your application that the user changes the selection, or the cursor is moved to a new position. Use the SelText property to get the selected text. The SelStart and SelLenght properties determine the position of the selected text. Use the SelForeColor and SelBackColor properties to specify the colors for the selected text. Use the Change event to notify your application when the user alters the control's text.

The following VB sample displays the selected text when the user changes it:

Private Sub CalcCalcEdit1_SelChange()
     Debug.Print CalcEdit1.SelText
End Sub

The following C++ sample displays the selected text when the user changes it:

void OnSelChangeCalcEdit1() 
{
	OutputDebugString( m_edit.GetSelText() );
}

The following VB.NET sample displays the selected text when the user changes it:

Private Sub AxCalcCalcEdit1_SelChange(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxCalcEdit1.SelChange
    With AxCalcEdit1
        Debug.WriteLine(.SelText)
    End With
End Sub

The following C# sample displays the selected text when the user changes it:

private void axCalcCalcEdit1_SelChange(object sender, EventArgs e)
{
	System.Diagnostics.Debug.WriteLine(axCalcEdit1.SelText);
}

The following VFP sample displays the selected text when the user changes it:

*** ActiveX Control Event ***

with thisform.CalcEdit1
	wait window nowait .SelText
endwith


Send comments on this topic.
© 1999-2006 Exontrol Inc, Software. All rights reserved.