home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 April
/
Chip_2001-04_cd1.bin
/
chplus
/
vb
/
vbkids20.exe
/
VBKids
/
VBKProjects
/
VB4Projects
/
Sample.Frm
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1998-08-29
|
16KB
|
492 lines
VERSION 4.00
Begin VB.Form frmSample
BorderStyle = 1 'Fixed Single
Caption = "Visual Basic for Kids - Sample"
ClientHeight = 5100
ClientLeft = 1500
ClientTop = 1035
ClientWidth = 5790
Height = 5505
Left = 1440
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5100
ScaleWidth = 5790
Top = 690
Width = 5910
Begin VB.Frame fraColor
Caption = "Color"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1095
Left = 2040
TabIndex = 0
Top = 2760
Width = 2775
Begin VB.OptionButton optBlack
Caption = "Black"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 4
Top = 600
Width = 1215
End
Begin VB.OptionButton optGreen
Caption = "Green"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 3
Top = 240
Width = 1215
End
Begin VB.OptionButton optRed
Caption = "Red"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 2
Top = 600
Width = 1215
End
Begin VB.OptionButton optBlue
Caption = "Blue"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 1
Top = 240
Width = 1215
End
End
Begin VB.CommandButton cmdBall
Caption = "Start"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4920
TabIndex = 18
Top = 4560
Width = 735
End
Begin VB.Timer timBall
Enabled = 0 'False
Interval = 100
Left = 3960
Top = 4680
End
Begin VB.PictureBox picBall
BackColor = &H0000FFFF&
Height = 4335
Left = 4920
ScaleHeight = 4275
ScaleWidth = 675
TabIndex = 17
Top = 120
Width = 735
Begin VB.Shape shpBall
BackColor = &H000000FF&
BackStyle = 1 'Opaque
FillColor = &H00FF0000&
FillStyle = 7 'Diagonal Cross
Height = 495
Left = 120
Shape = 3 'Circle
Top = 1560
Width = 495
End
End
Begin VB.Frame fraPick
Caption = "Pick a Number"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1095
Left = 120
TabIndex = 13
Top = 2760
Width = 1815
Begin VB.HScrollBar hsbPick
Height = 255
LargeChange = 10
Left = 360
Max = 100
TabIndex = 15
Top = 720
Width = 1095
End
Begin VB.Label lblPick
Alignment = 2 'Center
BackColor = &H00FFFFFF&
BorderStyle = 1 'Fixed Single
Caption = "0"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 14
Top = 360
Width = 1095
End
End
Begin VB.Frame fraStuff
Caption = "Toys"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2535
Left = 120
TabIndex = 7
Top = 120
Width = 1335
Begin VB.CheckBox chkTop
Caption = "Top"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 16
Top = 1320
Width = 1095
End
Begin VB.CheckBox chkTrike
Caption = "Trike"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 12
Top = 2040
Width = 1095
End
Begin VB.CheckBox chkWagon
Caption = "Wagon"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 11
Top = 1680
Width = 1095
End
Begin VB.CheckBox chkDoll
Caption = "Doll"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 10
Top = 960
Width = 1095
End
Begin VB.CheckBox chkBear
Caption = "Bear"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 9
Top = 600
Width = 1095
End
Begin VB.CheckBox chkBall
Caption = "Ball"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 8
Top = 240
Width = 1095
End
End
Begin VB.TextBox txtBox
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1095
Left = 120
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 6
Top = 3960
Width = 2775
End
Begin VB.CommandButton cmdBeep
Caption = "Beep!"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3480
TabIndex = 5
Top = 4080
Width = 975
End
Begin VB.Image imgTrike
Height = 1095
Left = 3720
Picture = "Sample.frx":0000
Stretch = -1 'True
Top = 1560
Visible = 0 'False
Width = 975
End
Begin VB.Image imgTop
Height = 1095
Left = 2640
Picture = "Sample.frx":5442
Stretch = -1 'True
Top = 1560
Visible = 0 'False
Width = 975
End
Begin VB.Image imgBear
Height = 1095
Left = 2640
Picture = "Sample.frx":6724
Stretch = -1 'True
Top = 240
Visible = 0 'False
Width = 975
End
Begin VB.Image imgDoll
Height = 1095
Left = 1560
Picture = "Sample.frx":73A6
Stretch = -1 'True
Top = 1560
Visible = 0 'False
Width = 975
End
Begin VB.Image imgWagon
Height = 1095
Left = 3720
Picture = "Sample.frx":8CC8
Stretch = -1 'True
Top = 240
Visible = 0 'False
Width = 975
End
Begin VB.Image imgBall
Height = 1095
Left = 1560
Picture = "Sample.frx":A1EA
Stretch = -1 'True
Top = 240
Visible = 0 'False
Width = 975
End
Attribute VB_Name = "frmSample"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Dim BallY As Integer, BallDir As Integer
Private Sub chkSkate_Click()
End Sub
Private Sub chkBall_Click()
If chkBall.Value = vbChecked Then
imgBall.Visible = True
imgBall.Visible = False
End If
End Sub
Private Sub chkBear_Click()
If chkBear.Value = vbChecked Then
imgBear.Visible = True
imgBear.Visible = False
End If
End Sub
Private Sub chkDoll_Click()
If chkDoll.Value = vbChecked Then
imgDoll.Visible = True
imgDoll.Visible = False
End If
End Sub
Private Sub chkTop_Click()
If chkTop.Value = vbChecked Then
imgTop.Visible = True
imgTop.Visible = False
End If
End Sub
Private Sub chkTrike_Click()
If chkTrike.Value = vbChecked Then
imgTrike.Visible = True
imgTrike.Visible = False
End If
End Sub
Private Sub chkWagon_Click()
If chkWagon.Value = vbChecked Then
imgWagon.Visible = True
imgWagon.Visible = False
End If
End Sub
Private Sub cmdBall_Click()
If timBall.Enabled = True Then
timBall.Enabled = False
cmdBall.Caption = "Start"
timBall.Enabled = True
cmdBall.Caption = "Stop"
End If
End Sub
Private Sub cmdBeep_Click()
End Sub
Private Sub Form_Load()
optBlue.Value = True
frmSample.BackColor = vbBlue
BallY = picBall.ScaleHeight - shpBall.Height
shpBall.Top = BallY
BallDir = -1
End Sub
Private Sub hsbPick_Change()
lblPick.Caption = Str(hsbPick.Value)
End Sub
Private Sub hsbPick_Scroll()
lblPick.Caption = Str(hsbPick.Value)
End Sub
Private Sub optBlack_Click()
frmSample.BackColor = vbBlack
End Sub
Private Sub optBlue_Click()
frmSample.BackColor = vbBlue
End Sub
Private Sub optGreen_Click()
frmSample.BackColor = vbGreen
End Sub
Private Sub optRed_Click()
frmSample.BackColor = vbRed
End Sub
Private Sub timBall_Timer()
BallY = BallY + BallDir * picBall.ScaleHeight / 50
If BallY < 0 Then
Beep
BallY = 0
BallDir = 1
ElseIf BallY > picBall.ScaleHeight - shpBall.Height Then
Beep
BallY = picBall.ScaleHeight - shpBall.Height
BallDir = -1
End If
shpBall.Top = BallY
End Sub