VB 4 Controls Scrollbar Radio button check box listboxes timers control arrays
Controls – tidying up layout
Scrollbar control
Scrollbar Controls example Label1 ScrollBar1 Label2 Picture1 Private Sub VScroll1_Change() Picture1.BackColor = RGB(0, 0, VScroll1.Value) Label2.Caption = "Colour is 0, 0, " & VScroll1.Value End Sub Exercise: Copy this Then add sliders for green and red
Radio buttons
Checkboxes
Listbox
Tab Control – adding it
Tab Control – designing with it
Timer control Hidden control Interval Tick event Enabled or not
Timer example – a clock Private Sub Timer1_Timer() Dim currentTime As Date currentTime = Now() Label1.Caption = currentTime End Sub
Timer exercise Program an animated ball which moves across a window Have a 'Shape' control and a timer Each tick event of the timer moves the shape: shape1.left = shape1.left + speed Make it bounce
Control arrays Sets of controls of same type which share code Have an index so know which is which Set up by copying and pasting first control Exercise Try this out Include a + and an = button