property Slider.Caption(Part as PartEnum) as String
Specifies the caption of the part of the control.

TypeDescription
Part as PartEnum A PartEnum expression that specifies the part where the text is displayed.
String A String expression that indicates the text being displayed. The Caption property support built-in HTML format as explained bellow.
Use the Caption property to specify a caption on any part of the control. Use the Font property to specify the control's font. Use the ForeColor property to specify the caption's color, if the <fgcolor> tag is not used. Use the Value property to specify the control's value. The CaptionAlignment property specifies the alignment of the caption in the part area. Use the CaptionIndentX property to indent the caption on the part, on the X axis. Use the CaptionIndentY property to indent the caption of the part on the Y axis. Use the Background property to change the visual appearance for any part of the control, in any state. The ImageSize property defines the size (width/height) of the icons within the control's Images collection.

The Caption property supports the following built-in HTML tags:

Also, newer HTML format supports decorative text like follows:

For instance, the following VB sample prints the control's Value on the control's thumb:

Private Sub Slider1_Change()
    With Slider1
        .Caption(exThumbPart) = .Value
    End With
End Sub

The following C++ sample prints the control's Value on the control's thumb:

void OnChangeSlider1() 
{
	CString strFormat;
	strFormat.Format( _T("%i"), m_slider.GetValue() );
	m_slider.SetCaption( 256, strFormat );
}

The following VB.NET sample prints the control's Value on the control's thumb:

With AxSlider1
    .set_Caption(EXSLIDERLib.PartEnum.exThumbPart, .Value.ToString())
End With

The following C# sample prints the control's Value on the control's thumb:

private void axSlider1_Change(object sender, EventArgs e)
{
    axSlider1.set_Caption(EXSLIDERLib.PartEnum.exThumbPart, axSlider1.Value.ToString());
}

The following VFP sample prints the control's Value on the control's thumb:

*** ActiveX Control Event ***

with thisform.Slider1
	.Caption(256) = .Value
endwith