Skip to content

SliderPaneClick Event

Description

Occurs when a slider pane has been clicked.

Syntax

Public Event SliderPaneClick( _
    ByVal Pane As StatusBarSliderPane, _
    ByVal Command As XTPSliderCommand, _
    ByVal Pos As Long _
)

Parameters

  • Pane: Reference to the slider pane that was clicked.
  • Command: Indicates where the slider was clicked.
Value Description
XTP_SB_LINELEFT The left "Min" button was clicked.
XTP_SB_LINERIGHT The right "Max" button was clicked.
XTP_SB_PAGELEFT The line of the slider was clicked to the left side of the thumb track.
XTP_SB_PAGERIGHT The line of the slider was clicked to the right side of the thumb track.
XTP_SB_THUMBTRACK The thumb track was clicked or is currently being dragged.
XTP_SB_LEFT Reserved for future use.
XTP_SB_RIGHT Reserved for future use.
XTP_SB_ENDSCROLL The control has finished scrolling.
  • Pos: The current position of the thumb tracker. Pos will be between Max and Min inclusively.

Remarks

SliderPaneClick occurs when a slider pane has been clicked. The current position of the thumb tracker is retrieved as well as how the slider was moved (clicked on button, thumb tracker, line, etc.).

The SliderPaneClick event can be used to update the Value of the slider. The Value will need to be manually maintained each time the slider is clicked. A value from the XTPSliderCommand enumeration will be passed to the SliderPaneClick event which specifies where the user clicked on the slider (clicked on button, thumb tracker, line, etc.) and the current position of the thumb tracker.

Slider Pane

Example

' Variable in global code section  
Dim ViewZoom As Long  

' Code to add slider  
Dim SliderPane As StatusBarSliderPane  
Set SliderPane = StatusBar.AddSliderPane(ID_INDICATOR_ZOOMSLIDER)  
SliderPane.Width = 130  
SliderPane.ToolTip = "Zoom"  
SliderPane.Min = 0  
SliderPane.Max = 200  
SliderPane.Value = 100  
SliderPane.Caption = "&Zoom Slider"  
SliderPane.BeginGroup = False  
ViewZoom = 100  

Private Sub StatusBar_SliderPaneClick(ByVal Pane As XtremeCommandBars.StatusBarSliderPane, ByVal Command As XtremeCommandBars.XTPSliderCommand, ByVal Pos As Long)  
    Dim nZoom As Long  
    nZoom = ViewZoom  

    Select Case Command  
        Case XTP_SB_LEFT: nZoom = 0  
        Case XTP_SB_RIGHT: nZoom = 200  
        Case XTP_SB_LINELEFT: nZoom = Max((Int(nZoom / 10) - 1) * 10, 0)  
        Case XTP_SB_LINERIGHT: nZoom = Min((Int(nZoom / 10) + 1) * 10, 200)  
        Case XTP_SB_THUMBTRACK: nZoom = Pos  
        Case XTP_SB_PAGELEFT: nZoom = Max(nZoom - 20, 0)  
        Case XTP_SB_PAGERIGHT: nZoom = Min(nZoom + 20, 200)  
    End Select  

    If (nZoom = ViewZoom) Then Exit Sub  

    ViewZoom = nZoom  
    Pane.Value = nZoom  
    StatusBar.FindPane(ID_INDICATOR_ZOOM).Text = nZoom & "%"  
End Sub

See Also


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.