The C1Elastic Control > Using C1Elastic by itself |
The C1Elastic control can replace the Label, Image, and Progress Bar controls that ship with Visual Basic.
To replace Label controls, use the Caption property to set the text you want to display, then use the CaptionPos property to align the text. Finally, use the BorderWidth and WordWrap properties to determine how far from the edges of the control the text should be displayed and whether or not it should be allowed to wrap. Unlike the Label control, the Elastic allows you to center multi-line captions vertically and to display pictures along with the text.
To replace Image controls, use the Picture property to select the picture you want to display and the PicturePos property to scale and align the picture. Finally, use the BorderWidth property to determine how far from the edges of the control the picture should be displayed. Unlike the Image control, the Elastic allows you to tile, align and scale the picture, and also to display text along with the picture.
To replace Progress Bar controls, use the FloodStyle, FloodDirection, and FloodColor properties to select the appearance of the progress bar, and set the FloodPercent property to a value between 0 and 100 to indicate the progress. Unlike the Progress Bar control, the Elastic allows you to use solid, block, or picture bars to indicate the progress, and to fill the indicator in any direction.
The picture below shows an Elastic control being used to replace a Label and a Progress Bar controls.
And here is the code that created the Elastic control (the control name is el):
Example Title |
Copy Code
|
---|---|
Private Sub Form_Load() With el .Frame = fcClient .FrameStyle = ftGroove .Picture = LoadPicture(App.Path & "\stone.gif") .PicturePos = ppTile .FloodStyle = fsPicture .FloodDirection = fdRight .FloodPercent = 75 .CaptionPos = cpCenterCenter .Caption = el.FloodPercent & " %" End With End Sub |