Download presentation
Presentation is loading. Please wait.
Published byGriselda Clarke Modified over 9 years ago
1
VB 4 Controls Scrollbar Radio button check box listboxes timers control arrays
2
Controls – tidying up layout
3
Scrollbar control
4
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
5
Radio buttons
6
Checkboxes
7
Listbox
8
Tab Control – adding it
9
Tab Control – designing with it
10
Timer control Hidden control Interval Tick event Enabled or not
11
Timer example – a clock Private Sub Timer1_Timer() Dim currentTime As Date currentTime = Now() Label1.Caption = currentTime End Sub
12
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
13
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.