event Change ()
Indicates that the control's text have changed.

 TypeDescription 

Use the Change event to notify you application that the user changes the text in the control. Use the Text property to access the control's text. Use the InsertText and DeleteLine methods to update the control's text. Use the AddKeyword method to add keywords to the control's content. Use the AddExpression method to add new expressions to the control's content. Use the CaretLine property to determine the position of the caret. Use the TextLine property to access a line giving its index.

The following VB sample displays the line where the change occurs:

Private Sub Edit1_Change()
    With Edit1
        Debug.Print .TextLine(.CaretLine)
    End With
End Sub

The following C++ sample displays the line where the change occurs:

void OnChangeEdit1() 
{
	if ( ::IsWindow( m_edit.m_hWnd ) )
		OutputDebugString( m_edit.GetTextLine( m_edit.GetCaretLine() ) );
}

The following VB.NET sample displays the line where the change occurs:

Private Sub AxEdit1_Change(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxEdit1.Change
    With AxEdit1
        Debug.WriteLine(.get_TextLine(.CaretLine))
    End With
End Sub

The following C# sample displays the line where the change occurs:

private void axEdit1_Change(object sender, EventArgs e)
{
	System.Diagnostics.Debug.WriteLine(axEdit1.get_TextLine(axEdit1.CaretLine));
}

The following VFP sample displays the line where the change occurs:

*** ActiveX Control Event ***

with thisform.Edit1
	wait window nowait .TextLine(.CaretLine)
endwith

 


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