Type | Description |
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 ChangeOnKey property specifies the code of the last key that alters the control's text.
Syntax for Change event, /NET version, on:
private void Change(object sender) { } Private Sub Change(ByVal sender As System.Object) Handles Change End Sub |
private void Change(object sender, EventArgs e) { } void OnChange() { } void __fastcall Change(TObject *Sender) { } procedure Change(ASender: TObject; ); begin end; procedure Change(sender: System.Object; e: System.EventArgs); begin end; begin event Change() end event Change Private Sub Change(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Change End Sub Private Sub Change() End Sub Private Sub Change() End Sub LPARAMETERS nop PROCEDURE OnChange(oEdit) RETURN |
<SCRIPT EVENT="Change()" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function Change() End Function </SCRIPT> Procedure OnComChange Forward Send OnComChange End_Procedure METHOD OCX_Change() CLASS MainDialog RETURN NIL void onEvent_Change() { } function Change as v () end function function nativeObject_Change() return |
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