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 scroll box 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, AxEXSCROLLBARLib._IScrollBarEvents_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: AxEXSCROLLBARLib._IScrollBarEvents_ChangingEvent); begin end; begin event Changing(long OldValue,long NewValue) end event Changing Private Sub Changing(ByVal sender As System.Object, ByVal e As AxEXSCROLLBARLib._IScrollBarEvents_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(oScrollBar,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 samples prints the old and the new value on the thumb part of the control:
Private Sub ScrollBar1_Changing(ByVal OldValue As Long, NewValue As Long) With ScrollBar1 .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 AxScrollBar1_Changing(ByVal sender As System.Object, ByVal e As AxEXSCROLLBARLib._IScrollBarEvents_ChangingEvent) Handles AxScrollBar1.Changing With AxScrollBar1 .set_Caption(EXSCROLLBARLib.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 OnChangingScrollbar1(long OldValue, long FAR* NewValue) { CString strFormat; strFormat.Format( _T("<img></img>%i - %i"), OldValue, *NewValue ); m_scrollbar.SetCaption( 256, strFormat ); }
The following C# samples prints the old and the new value on the thumb part of the control:
private void axScrollBar1_Changing(object sender, AxEXSCROLLBARLib._IScrollBarEvents_ChangingEvent e) { axScrollBar1.set_Caption(EXSCROLLBARLib.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.ScrollBar1 .Caption(256) = "<img></img>" + ltrim(Str(oldvalue)) + " - " + ltrim(Str(newvalue)) endwith