Unit 2
Unit 2
Change :event is triggered after the scroll bar position has been
modified.Use this event to retrieve the value property after any change
in the scroll bar
Control Properties
Label Caption
Scroll Bar1 Max(255) ,Min
(0)
Largechange (10)
Scroll Bar2 Max(255) ,Min
(0)
Largechange (10
Scroll Bar3 Max(255) ,Min
(0)
Largechange (10
General
Dim r,g,b as integers
Private sub form_Load()
r=g=b=0
End Sub
o Set the Image property to "1" or "New". This is how you tie an
image in the ImageList control to a button on the toolbar. The value
you type for the Image property here refers to either the Index or the
Key property of the desired image in the ImageList control.
Click the "Insert Button" button again.
Leave the Key, ToolTipText, and
Image properties alone, but set the
Style property to "3 – tbrSeparator". If
you look back at the screen-shot
showing the Flat toolbar Style, you'll
see that a vertical line separates each
button in the toolbar. This is actually
done by setting the Style property of
every other button to "3 –
tbrSeparator". The Property Pages
dialog box should look like this:
9. code the Click event for the toolbar, which will test which button the
user pressed, then call the corresponding menu click event procedure
(and the menu events have already been coded). For example, if the user
clicks the Open button on the toolbar, we simply want to call the
mnuFileOpen_Click event procedure.
Slider and ScrollBar are very similar in use. Both controls have an
Orientation property to select between vertical and horizontal modes.
They both derive from a common base class, RangeBase. This provides
Minimum and Maximum properties, which define the range of values the
control represents, and a Value property holding the currently selected
value. It also defines SmallChange and LargeChange properties, which
determine by how much the Value changes when adjusted with the arrow
keys, or the Page Up and Page Down keys, respectively. The
LargeChange value is also used when the part of the slider track on either
side of the thumb is clicked.Whereas slider controls have a fixed-size
thumb, the thumb on a scroll bar can change in size
Adding a slider to a program
1. Select the Project/Components menu item, and click the Controls tab
the Components box that opens.
2. Select the Microsoft Windows Common Controls item
3. Close the Components box by clicking on OK.
4. The Slider tool appears in the toolbox at this point. Add a slider to te
form in the usual way.
5. Set the slider's Orientation property to ccOrientationHorizontal (value 0,
the default) or ceOrientationVertical (value 1) to specify the orientation
you want.
6. Set the slider's Min, Max, SmallChange, and Large Change values
as you want them.
7. Add the code to a slider’s change event
The rich text box control alow user to display enter and edit text while
also providing more advanced formatting feature then the conventional
text box control.The rich text box control is a custom control we will
need to add it to the tool box if It is not already ther ,To do this :- Select
project>component>MS Window common control 6.0
Listview1.listitems.add
text=textroll.text
listview1.listitem.item(1)
Listview1.listitems.add
text=textcourse.text
listview1.listitem.item(1)
End sub
Progress Bar
The loading bars are used for any type of application and software.
The main question is how to create a progress bar in visual basic,
this concept is used for giving the visualization about the current
status of the current process and computer operation, such as
downloading, transferring files, installation, and more. If you also
don't know about this topic then read this post properly you will get
your answer.
Design the form as per the given image
Visual basic progress bar source code
Private Sub Form_Load()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
ProgressBar1.Value = ProgressBar1.Value + 5
load.Caption = "Please wait! Setup is loading....."
per.Caption = ProgressBar1.Value & "%"
If ProgressBar1.Value = ProgressBar1.Max Then
Timer1.Enabled = False
MsgBox "Installation is completed successfully"
Unload Me
End If
End Sub