property Slider.Background(Part as BackgroundPartEnum) as Color
Returns or sets a value that indicates the background color for parts in the control.

 TypeDescription 
   Part as BackgroundPartEnum A BackgroundPartEnum expression that indicates the part and the state whose visual appearance is changed.  
   Color A Color expression that indicates the background color for a specified part. The last 7 bits in the high significant byte of the color to indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part.  
The Background property specifies a background color or a visual appearance for specific parts in the control. If the Background property is 0, the control draws the part as default. Use the Add method to add new skins to the control. Use the Remove method to remove a specific skin from the control. Use the Clear method to remove all skins in the control. Use the BeginUpdate and EndUpdate methods to maintain performance while multiple changes are applied. Use the VisiblePart or VisibleParts property to specify visible parts in the control.

In the following samples, we have used the following skin file:  and we get the following slider:

The following VB sample changes the visual appearance of the thumb, in the vertical slider:

With Slider1
    .VisualAppearance.Add 1, "D:\Exontrol\ExSlider\sample\VB\Gauge\Vertical 2\thumb.ebn"
    .Background(exVSThumb) = &H1000000
End With

The following VB sample changes the visual appearance of the thumb ( when it is pressed ), in the vertical slider:

With Slider1
    .VisualAppearance.Add 1, "D:\Exontrol\ExSlider\sample\VB\Gauge\Vertical 2\thumb.ebn"
    .Background(exVSThumbP) = &H1000000
End With

The following C++ sample changes the visual appearance of the thumb, in the vertical slider:

m_slider.GetVisualAppearance().Add( 1, COleVariant( _T("D:\\Exontrol\\ExSlider\\sample\\VB\\Gauge\\Vertical 2\\thumb.ebn") ) );
m_slider.SetBackground( 260 /*exVSThumb*/, 0x01000000 );

The following C++ sample changes the visual appearance of the thumb ( when it is pressed ), in the vertical slider:

m_slider.GetVisualAppearance().Add( 1, COleVariant( _T("D:\\Exontrol\\ExSlider\\sample\\VB\\Gauge\\Vertical 2\\thumb.ebn") ) );
m_slider.SetBackground( 261 /*exVSThumbP*/, 0x01000000 );

The following VB.NET sample changes the visual appearance of the thumb, in the vertical slider:

With AxSlider1
    .VisualAppearance.Add(1, "D:\Exontrol\ExSlider\sample\VB\Gauge\Vertical 2\thumb.ebn")
    .set_Background(EXSLIDERLib.BackgroundPartEnum.exVSThumb, &H1000000)
End With

The following VB.NET sample changes the visual appearance of the thumb ( when it is pressed ), in the vertical slider:

With AxSlider1
    .VisualAppearance.Add(1, "D:\Exontrol\ExSlider\sample\VB\Gauge\Vertical 2\thumb.ebn")
    .set_Background(EXSLIDERLib.BackgroundPartEnum.exVSThumbP, &H1000000)
End With

The following C# sample changes the visual appearance of the thumb, in the vertical slider:

axSlider1.VisualAppearance.Add(1, "D:\\Exontrol\\ExSlider\\sample\\VB\\Gauge\\Vertical 2\\thumb.ebn");
axSlider1.set_Background(EXSLIDERLib.BackgroundPartEnum.exVSThumb, 0x1000000);

The following C# sample changes the visual appearance of the thumb ( when it is pressed ), in the vertical slider:

axSlider1.VisualAppearance.Add(1, "D:\\Exontrol\\ExSlider\\sample\\VB\\Gauge\\Vertical 2\\thumb.ebn");
axSlider1.set_Background(EXSLIDERLib.BackgroundPartEnum.exVSThumbP, 0x1000000);

The following VFP sample changes the visual appearance of the thumb, in the vertical slider:

with thisform.Slider1
    .VisualAppearance.Add(1, "D:\Exontrol\ExSlider\sample\VB\Gauge\Vertical 2\thumb.ebn")
    .Background(260) = 0x1000000
endwith

The following VFP sample changes the visual appearance of the thumb ( when it is pressed ), in the vertical slider:

with thisform.Slider1
    .VisualAppearance.Add(1, "D:\Exontrol\ExSlider\sample\VB\Gauge\Vertical 2\thumb.ebn")
    .Background(261) = 0x1000000
endwith

 


Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.