VB 4 Controls - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

VB 4 Controls

Description:

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: ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 14
Provided by: walter63
Category:
Tags: controls | timer

less

Transcript and Presenter's Notes

Title: VB 4 Controls


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
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
ScrollBar1
Label2
Label1
Picture1
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
Write a Comment
User Comments (0)
About PowerShow.com