Type | Description | |||
OldValue as Long | A long expression that indicates the control's Value before performing the change. | |||
NewValue as Long | (By Reference) (by reference) A long expression that indicates the control's newly value. |
The Changing event notifies your application just before changing the control's Value. Use the Changing event to prevent specified values, since the NewValue parameter is passed by reference so you can change during the handler. The control fires the Change event after user changes the value. Use the Minimum and Maximum properties to specify the range's value. Use the Caption property to put a HTML text on any part of the control. The SmallChange property gets or sets the value added to or subtracted from the Value property when the thumb is moved a small distance. The LargeChange property gets or sets a value to be added to or subtracted from the Value property when the slider is moved a large distance.
Syntax for Changing event, /NET version, on:
private void Changing(object sender,int OldValue,ref int NewValue) { } Private Sub Changing(ByVal sender As System.Object,ByVal OldValue As Integer,ByRef NewValue As Integer) Handles Changing End Sub |
private void Changing(object sender, AxEXSLIDERLib._ISliderEvents_ChangingEvent e) { } void OnChanging(long OldValue,long FAR* NewValue) { } void __fastcall Changing(TObject *Sender,long OldValue,long * NewValue) { } procedure Changing(ASender: TObject; OldValue : Integer;var NewValue : Integer); begin end; procedure Changing(sender: System.Object; e: AxEXSLIDERLib._ISliderEvents_ChangingEvent); begin end; begin event Changing(long OldValue,long NewValue) end event Changing Private Sub Changing(ByVal sender As System.Object, ByVal e As AxEXSLIDERLib._ISliderEvents_ChangingEvent) Handles Changing End Sub Private Sub Changing(ByVal OldValue As Long,NewValue As Long) End Sub Private Sub Changing(ByVal OldValue As Long,NewValue As Long) End Sub LPARAMETERS OldValue,NewValue PROCEDURE OnChanging(oSlider,OldValue,NewValue) RETURN |
<SCRIPT EVENT="Changing(OldValue,NewValue)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function Changing(OldValue,NewValue) End Function </SCRIPT> Procedure OnComChanging Integer llOldValue Integer llNewValue Forward Send OnComChanging llOldValue llNewValue End_Procedure METHOD OCX_Changing(OldValue,NewValue) CLASS MainDialog RETURN NIL void onEvent_Changing(int _OldValue,COMVariant /*long*/ _NewValue) { } function Changing as v (OldValue as N,NewValue as N) end function function nativeObject_Changing(OldValue,NewValue) return |
The following VB sample limits the control's Value to SmallChange property:
Private Sub Slider1_Changing(ByVal OldValue As Long, NewValue As Long) With Slider1 NewValue = CLng(NewValue / .SmallChange) * .SmallChange If NewValue > .Maximum Then NewValue = .Maximum End If End With End Sub
The following VB samples prints the old and the new value on the thumb part of the control:
Private Sub Slider1_Changing(ByVal OldValue As Long, NewValue As Long) With Slider1 .Caption(exThumbPart) = "<img></img>" & OldValue & " - " & NewValue End With End Sub
The following VB.NET samples prints the old and the new value on the thumb part of the control:
Private Sub AxSlider1_Changing(ByVal sender As System.Object, ByVal e As AxEXSLIDERLib._ISliderEvents_ChangingEvent) Handles AxSlider1.Changing With AxSlider1 .set_Caption(EXSLIDERLib.PartEnum.exThumbPart, "<img></img>" + e.oldValue.ToString() + " - " + e.newValue.ToString()) End With End Sub
The following C++ samples prints the old and the new value on the thumb part of the control:
void OnChangingSlider1(long OldValue, long FAR* NewValue) { CString strFormat; strFormat.Format( _T("<img></img>%i - %i"), OldValue, *NewValue ); m_slider.SetCaption( 256, strFormat ); }
The following C# samples prints the old and the new value on the thumb part of the control:
private void axSlider1_Changing(object sender, AxEXSLIDERLib._ISliderEvents_ChangingEvent e) { axSlider1.set_Caption(EXSLIDERLib.PartEnum.exThumbPart, "<img></img>" + e.oldValue.ToString() + " - " + e.newValue.ToString()); }
The following VFP samples prints the old and the new value on the thumb part of the control:
*** ActiveX Control Event *** LPARAMETERS oldvalue, newvalue with thisform.Slider1 .Caption(256) = "<img></img>" + ltrim(Str(oldvalue)) + " - " + ltrim(Str(newvalue)) endwith