Type | Description | |||
NewValue as Variant | (By Reference) A Variant expression that holds the new value for the editor. |
The ValueChanged event is fired just before changing the editor's Value property. The ValueChanged event notifies your application that the value of the editor is changing. The FindItem property gets the caption associated to a value if the editor contains a predefined list ( DropDownList ).
Syntax for ValueChanged event, /NET version, on:
private void ValueChanged(object sender,ref object NewValue) { } Private Sub ValueChanged(ByVal sender As System.Object,ByRef NewValue As Object) Handles ValueChanged End Sub |
private void ValueChanged(object sender, AxEXEDITORSLib._IEditorEvents_ValueChangedEvent e) { } void OnValueChanged(VARIANT FAR* NewValue) { } void __fastcall ValueChanged(TObject *Sender,Variant * NewValue) { } procedure ValueChanged(ASender: TObject; var NewValue : OleVariant); begin end; procedure ValueChanged(sender: System.Object; e: AxEXEDITORSLib._IEditorEvents_ValueChangedEvent); begin end; begin event ValueChanged(any NewValue) end event ValueChanged Private Sub ValueChanged(ByVal sender As System.Object, ByVal e As AxEXEDITORSLib._IEditorEvents_ValueChangedEvent) Handles ValueChanged End Sub Private Sub ValueChanged(NewValue As Variant) End Sub Private Sub ValueChanged(NewValue As Variant) End Sub LPARAMETERS NewValue PROCEDURE OnValueChanged(oEditor,NewValue) RETURN |
<SCRIPT EVENT="ValueChanged(NewValue)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function ValueChanged(NewValue) End Function </SCRIPT> Procedure OnComValueChanged Variant llNewValue Forward Send OnComValueChanged llNewValue End_Procedure METHOD OCX_ValueChanged(NewValue) CLASS MainDialog RETURN NIL void onEvent_ValueChanged(COMVariant /*variant*/ _NewValue) { } function ValueChanged as v (NewValue as A) end function function nativeObject_ValueChanged(NewValue) return |
The following sample shows how to restore the old value after user changes the editor's data:
Option Explicit Dim iChanging As Long Private Sub Editor1_ValueChanged(NewValue As Variant) If (iChanging = 0) Then With Editor1 NewValue = .Value End With End If End Sub Private Sub Form_Load() iChanging = 0 With Editor1 .EditType = DropDownList .AddItem 1, "One" .AddItem 2, "Two" iChanging = iChanging + 1 .Value = 1 iChanging = iChanging - 1 End With End Sub
The following sample displays the newly value:
Option Explicit Dim iChanging As Long Private Sub Editor1_ValueChanged(NewValue As Variant) With Editor1 Debug.Print "The user changes the editor's value to " & NewValue End With End Sub Private Sub Form_Load() iChanging = 0 With Editor1 .EditType = DropDownList .AddItem 1, "One" .AddItem 2, "Two" iChanging = iChanging + 1 .Value = 1 iChanging = iChanging - 1 End With End Sub