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 >
Visual Basic Form  |  1998-08-29  |  16KB  |  492 lines

  1. VERSION 4.00
  2. Begin VB.Form frmSample 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Visual Basic for Kids - Sample"
  5.    ClientHeight    =   5100
  6.    ClientLeft      =   1500
  7.    ClientTop       =   1035
  8.    ClientWidth     =   5790
  9.    Height          =   5505
  10.    Left            =   1440
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   5100
  15.    ScaleWidth      =   5790
  16.    Top             =   690
  17.    Width           =   5910
  18.    Begin VB.Frame fraColor 
  19.       Caption         =   "Color"
  20.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  21.          Name            =   "MS Sans Serif"
  22.          Size            =   9.75
  23.          Charset         =   0
  24.          Weight          =   700
  25.          Underline       =   0   'False
  26.          Italic          =   0   'False
  27.          Strikethrough   =   0   'False
  28.       EndProperty
  29.       Height          =   1095
  30.       Left            =   2040
  31.       TabIndex        =   0
  32.       Top             =   2760
  33.       Width           =   2775
  34.       Begin VB.OptionButton optBlack 
  35.          Caption         =   "Black"
  36.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  37.             Name            =   "MS Sans Serif"
  38.             Size            =   9.75
  39.             Charset         =   0
  40.             Weight          =   400
  41.             Underline       =   0   'False
  42.             Italic          =   0   'False
  43.             Strikethrough   =   0   'False
  44.          EndProperty
  45.          Height          =   375
  46.          Left            =   1440
  47.          TabIndex        =   4
  48.          Top             =   600
  49.          Width           =   1215
  50.       End
  51.       Begin VB.OptionButton optGreen 
  52.          Caption         =   "Green"
  53.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  54.             Name            =   "MS Sans Serif"
  55.             Size            =   9.75
  56.             Charset         =   0
  57.             Weight          =   400
  58.             Underline       =   0   'False
  59.             Italic          =   0   'False
  60.             Strikethrough   =   0   'False
  61.          EndProperty
  62.          Height          =   375
  63.          Left            =   1440
  64.          TabIndex        =   3
  65.          Top             =   240
  66.          Width           =   1215
  67.       End
  68.       Begin VB.OptionButton optRed 
  69.          Caption         =   "Red"
  70.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  71.             Name            =   "MS Sans Serif"
  72.             Size            =   9.75
  73.             Charset         =   0
  74.             Weight          =   400
  75.             Underline       =   0   'False
  76.             Italic          =   0   'False
  77.             Strikethrough   =   0   'False
  78.          EndProperty
  79.          Height          =   375
  80.          Left            =   240
  81.          TabIndex        =   2
  82.          Top             =   600
  83.          Width           =   1215
  84.       End
  85.       Begin VB.OptionButton optBlue 
  86.          Caption         =   "Blue"
  87.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  88.             Name            =   "MS Sans Serif"
  89.             Size            =   9.75
  90.             Charset         =   0
  91.             Weight          =   400
  92.             Underline       =   0   'False
  93.             Italic          =   0   'False
  94.             Strikethrough   =   0   'False
  95.          EndProperty
  96.          Height          =   375
  97.          Left            =   240
  98.          TabIndex        =   1
  99.          Top             =   240
  100.          Width           =   1215
  101.       End
  102.    End
  103.    Begin VB.CommandButton cmdBall 
  104.       Caption         =   "Start"
  105.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  106.          Name            =   "MS Sans Serif"
  107.          Size            =   9.75
  108.          Charset         =   0
  109.          Weight          =   400
  110.          Underline       =   0   'False
  111.          Italic          =   0   'False
  112.          Strikethrough   =   0   'False
  113.       EndProperty
  114.       Height          =   495
  115.       Left            =   4920
  116.       TabIndex        =   18
  117.       Top             =   4560
  118.       Width           =   735
  119.    End
  120.    Begin VB.Timer timBall 
  121.       Enabled         =   0   'False
  122.       Interval        =   100
  123.       Left            =   3960
  124.       Top             =   4680
  125.    End
  126.    Begin VB.PictureBox picBall 
  127.       BackColor       =   &H0000FFFF&
  128.       Height          =   4335
  129.       Left            =   4920
  130.       ScaleHeight     =   4275
  131.       ScaleWidth      =   675
  132.       TabIndex        =   17
  133.       Top             =   120
  134.       Width           =   735
  135.       Begin VB.Shape shpBall 
  136.          BackColor       =   &H000000FF&
  137.          BackStyle       =   1  'Opaque
  138.          FillColor       =   &H00FF0000&
  139.          FillStyle       =   7  'Diagonal Cross
  140.          Height          =   495
  141.          Left            =   120
  142.          Shape           =   3  'Circle
  143.          Top             =   1560
  144.          Width           =   495
  145.       End
  146.    End
  147.    Begin VB.Frame fraPick 
  148.       Caption         =   "Pick a Number"
  149.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  150.          Name            =   "MS Sans Serif"
  151.          Size            =   9.75
  152.          Charset         =   0
  153.          Weight          =   700
  154.          Underline       =   0   'False
  155.          Italic          =   0   'False
  156.          Strikethrough   =   0   'False
  157.       EndProperty
  158.       Height          =   1095
  159.       Left            =   120
  160.       TabIndex        =   13
  161.       Top             =   2760
  162.       Width           =   1815
  163.       Begin VB.HScrollBar hsbPick 
  164.          Height          =   255
  165.          LargeChange     =   10
  166.          Left            =   360
  167.          Max             =   100
  168.          TabIndex        =   15
  169.          Top             =   720
  170.          Width           =   1095
  171.       End
  172.       Begin VB.Label lblPick 
  173.          Alignment       =   2  'Center
  174.          BackColor       =   &H00FFFFFF&
  175.          BorderStyle     =   1  'Fixed Single
  176.          Caption         =   "0"
  177.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  178.             Name            =   "MS Sans Serif"
  179.             Size            =   12
  180.             Charset         =   0
  181.             Weight          =   400
  182.             Underline       =   0   'False
  183.             Italic          =   0   'False
  184.             Strikethrough   =   0   'False
  185.          EndProperty
  186.          Height          =   375
  187.          Left            =   360
  188.          TabIndex        =   14
  189.          Top             =   360
  190.          Width           =   1095
  191.       End
  192.    End
  193.    Begin VB.Frame fraStuff 
  194.       Caption         =   "Toys"
  195.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  196.          Name            =   "MS Sans Serif"
  197.          Size            =   9.75
  198.          Charset         =   0
  199.          Weight          =   700
  200.          Underline       =   0   'False
  201.          Italic          =   0   'False
  202.          Strikethrough   =   0   'False
  203.       EndProperty
  204.       Height          =   2535
  205.       Left            =   120
  206.       TabIndex        =   7
  207.       Top             =   120
  208.       Width           =   1335
  209.       Begin VB.CheckBox chkTop 
  210.          Caption         =   "Top"
  211.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  212.             Name            =   "MS Sans Serif"
  213.             Size            =   9.75
  214.             Charset         =   0
  215.             Weight          =   400
  216.             Underline       =   0   'False
  217.             Italic          =   0   'False
  218.             Strikethrough   =   0   'False
  219.          EndProperty
  220.          Height          =   375
  221.          Left            =   120
  222.          TabIndex        =   16
  223.          Top             =   1320
  224.          Width           =   1095
  225.       End
  226.       Begin VB.CheckBox chkTrike 
  227.          Caption         =   "Trike"
  228.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  229.             Name            =   "MS Sans Serif"
  230.             Size            =   9.75
  231.             Charset         =   0
  232.             Weight          =   400
  233.             Underline       =   0   'False
  234.             Italic          =   0   'False
  235.             Strikethrough   =   0   'False
  236.          EndProperty
  237.          Height          =   375
  238.          Left            =   120
  239.          TabIndex        =   12
  240.          Top             =   2040
  241.          Width           =   1095
  242.       End
  243.       Begin VB.CheckBox chkWagon 
  244.          Caption         =   "Wagon"
  245.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  246.             Name            =   "MS Sans Serif"
  247.             Size            =   9.75
  248.             Charset         =   0
  249.             Weight          =   400
  250.             Underline       =   0   'False
  251.             Italic          =   0   'False
  252.             Strikethrough   =   0   'False
  253.          EndProperty
  254.          Height          =   375
  255.          Left            =   120
  256.          TabIndex        =   11
  257.          Top             =   1680
  258.          Width           =   1095
  259.       End
  260.       Begin VB.CheckBox chkDoll 
  261.          Caption         =   "Doll"
  262.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  263.             Name            =   "MS Sans Serif"
  264.             Size            =   9.75
  265.             Charset         =   0
  266.             Weight          =   400
  267.             Underline       =   0   'False
  268.             Italic          =   0   'False
  269.             Strikethrough   =   0   'False
  270.          EndProperty
  271.          Height          =   375
  272.          Left            =   120
  273.          TabIndex        =   10
  274.          Top             =   960
  275.          Width           =   1095
  276.       End
  277.       Begin VB.CheckBox chkBear 
  278.          Caption         =   "Bear"
  279.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  280.             Name            =   "MS Sans Serif"
  281.             Size            =   9.75
  282.             Charset         =   0
  283.             Weight          =   400
  284.             Underline       =   0   'False
  285.             Italic          =   0   'False
  286.             Strikethrough   =   0   'False
  287.          EndProperty
  288.          Height          =   375
  289.          Left            =   120
  290.          TabIndex        =   9
  291.          Top             =   600
  292.          Width           =   1095
  293.       End
  294.       Begin VB.CheckBox chkBall 
  295.          Caption         =   "Ball"
  296.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  297.             Name            =   "MS Sans Serif"
  298.             Size            =   9.75
  299.             Charset         =   0
  300.             Weight          =   400
  301.             Underline       =   0   'False
  302.             Italic          =   0   'False
  303.             Strikethrough   =   0   'False
  304.          EndProperty
  305.          Height          =   375
  306.          Left            =   120
  307.          TabIndex        =   8
  308.          Top             =   240
  309.          Width           =   1095
  310.       End
  311.    End
  312.    Begin VB.TextBox txtBox 
  313.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  314.          Name            =   "MS Sans Serif"
  315.          Size            =   9.75
  316.          Charset         =   0
  317.          Weight          =   400
  318.          Underline       =   0   'False
  319.          Italic          =   0   'False
  320.          Strikethrough   =   0   'False
  321.       EndProperty
  322.       Height          =   1095
  323.       Left            =   120
  324.       MultiLine       =   -1  'True
  325.       ScrollBars      =   2  'Vertical
  326.       TabIndex        =   6
  327.       Top             =   3960
  328.       Width           =   2775
  329.    End
  330.    Begin VB.CommandButton cmdBeep 
  331.       Caption         =   "Beep!"
  332.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  333.          Name            =   "Arial"
  334.          Size            =   12
  335.          Charset         =   0
  336.          Weight          =   700
  337.          Underline       =   0   'False
  338.          Italic          =   0   'False
  339.          Strikethrough   =   0   'False
  340.       EndProperty
  341.       Height          =   495
  342.       Left            =   3480
  343.       TabIndex        =   5
  344.       Top             =   4080
  345.       Width           =   975
  346.    End
  347.    Begin VB.Image imgTrike 
  348.       Height          =   1095
  349.       Left            =   3720
  350.       Picture         =   "Sample.frx":0000
  351.       Stretch         =   -1  'True
  352.       Top             =   1560
  353.       Visible         =   0   'False
  354.       Width           =   975
  355.    End
  356.    Begin VB.Image imgTop 
  357.       Height          =   1095
  358.       Left            =   2640
  359.       Picture         =   "Sample.frx":5442
  360.       Stretch         =   -1  'True
  361.       Top             =   1560
  362.       Visible         =   0   'False
  363.       Width           =   975
  364.    End
  365.    Begin VB.Image imgBear 
  366.       Height          =   1095
  367.       Left            =   2640
  368.       Picture         =   "Sample.frx":6724
  369.       Stretch         =   -1  'True
  370.       Top             =   240
  371.       Visible         =   0   'False
  372.       Width           =   975
  373.    End
  374.    Begin VB.Image imgDoll 
  375.       Height          =   1095
  376.       Left            =   1560
  377.       Picture         =   "Sample.frx":73A6
  378.       Stretch         =   -1  'True
  379.       Top             =   1560
  380.       Visible         =   0   'False
  381.       Width           =   975
  382.    End
  383.    Begin VB.Image imgWagon 
  384.       Height          =   1095
  385.       Left            =   3720
  386.       Picture         =   "Sample.frx":8CC8
  387.       Stretch         =   -1  'True
  388.       Top             =   240
  389.       Visible         =   0   'False
  390.       Width           =   975
  391.    End
  392.    Begin VB.Image imgBall 
  393.       Height          =   1095
  394.       Left            =   1560
  395.       Picture         =   "Sample.frx":A1EA
  396.       Stretch         =   -1  'True
  397.       Top             =   240
  398.       Visible         =   0   'False
  399.       Width           =   975
  400.    End
  401. Attribute VB_Name = "frmSample"
  402. Attribute VB_Creatable = False
  403. Attribute VB_Exposed = False
  404. Option Explicit
  405. Dim BallY As Integer, BallDir As Integer
  406. Private Sub chkSkate_Click()
  407. End Sub
  408. Private Sub chkBall_Click()
  409. If chkBall.Value = vbChecked Then
  410.   imgBall.Visible = True
  411.   imgBall.Visible = False
  412. End If
  413. End Sub
  414. Private Sub chkBear_Click()
  415. If chkBear.Value = vbChecked Then
  416.   imgBear.Visible = True
  417.   imgBear.Visible = False
  418. End If
  419. End Sub
  420. Private Sub chkDoll_Click()
  421. If chkDoll.Value = vbChecked Then
  422.   imgDoll.Visible = True
  423.   imgDoll.Visible = False
  424. End If
  425. End Sub
  426. Private Sub chkTop_Click()
  427. If chkTop.Value = vbChecked Then
  428.   imgTop.Visible = True
  429.   imgTop.Visible = False
  430. End If
  431. End Sub
  432. Private Sub chkTrike_Click()
  433. If chkTrike.Value = vbChecked Then
  434.   imgTrike.Visible = True
  435.   imgTrike.Visible = False
  436. End If
  437. End Sub
  438. Private Sub chkWagon_Click()
  439. If chkWagon.Value = vbChecked Then
  440.   imgWagon.Visible = True
  441.   imgWagon.Visible = False
  442. End If
  443. End Sub
  444. Private Sub cmdBall_Click()
  445. If timBall.Enabled = True Then
  446.   timBall.Enabled = False
  447.   cmdBall.Caption = "Start"
  448.   timBall.Enabled = True
  449.   cmdBall.Caption = "Stop"
  450. End If
  451. End Sub
  452. Private Sub cmdBeep_Click()
  453. End Sub
  454. Private Sub Form_Load()
  455. optBlue.Value = True
  456. frmSample.BackColor = vbBlue
  457. BallY = picBall.ScaleHeight - shpBall.Height
  458. shpBall.Top = BallY
  459. BallDir = -1
  460. End Sub
  461. Private Sub hsbPick_Change()
  462. lblPick.Caption = Str(hsbPick.Value)
  463. End Sub
  464. Private Sub hsbPick_Scroll()
  465. lblPick.Caption = Str(hsbPick.Value)
  466. End Sub
  467. Private Sub optBlack_Click()
  468. frmSample.BackColor = vbBlack
  469. End Sub
  470. Private Sub optBlue_Click()
  471. frmSample.BackColor = vbBlue
  472. End Sub
  473. Private Sub optGreen_Click()
  474. frmSample.BackColor = vbGreen
  475. End Sub
  476. Private Sub optRed_Click()
  477. frmSample.BackColor = vbRed
  478. End Sub
  479. Private Sub timBall_Timer()
  480. BallY = BallY + BallDir * picBall.ScaleHeight / 50
  481. If BallY < 0 Then
  482.   Beep
  483.   BallY = 0
  484.   BallDir = 1
  485. ElseIf BallY > picBall.ScaleHeight - shpBall.Height Then
  486.   Beep
  487.   BallY = picBall.ScaleHeight - shpBall.Height
  488.   BallDir = -1
  489. End If
  490. shpBall.Top = BallY
  491. End Sub
  492.