home *** CD-ROM | disk | FTP | other *** search
/ PC World 1999 April / PCWorld_1999-04_cd.bin / Software / Vyzkuste / BegVisB / BeginVBSW / BVBProjects / VB4Projects / Sample.Frm (.txt) < prev    next >
Visual Basic Form  |  1999-01-26  |  16KB  |  490 lines

  1. VERSION 4.00
  2. Begin VB.Form frmSample 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Beginning Visual Basic - Sample"
  5.    ClientHeight    =   5100
  6.    ClientLeft      =   645
  7.    ClientTop       =   1020
  8.    ClientWidth     =   7035
  9.    Height          =   5505
  10.    Left            =   585
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   5100
  15.    ScaleWidth      =   7035
  16.    Top             =   675
  17.    Width           =   7155
  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            =   2760
  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            =   6120
  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            =   3840
  124.       Top             =   4680
  125.    End
  126.    Begin VB.PictureBox picBall 
  127.       BackColor       =   &H0000FFFF&
  128.       Height          =   4335
  129.       Left            =   6120
  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         =   "Stuff"
  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           =   1575
  209.       Begin VB.CheckBox chkCard 
  210.          Caption         =   "Card"
  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 chkFootball 
  227.          Caption         =   "Football"
  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 chkBaseball 
  244.          Caption         =   "Baseball"
  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           =   1335
  259.       End
  260.       Begin VB.CheckBox chkHouse 
  261.          Caption         =   "House"
  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 chkTruck 
  278.          Caption         =   "Truck"
  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 chkCar 
  295.          Caption         =   "Car"
  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            =   3960
  343.       TabIndex        =   5
  344.       Top             =   4080
  345.       Width           =   975
  346.    End
  347.    Begin VB.Image imgFootball 
  348.       Height          =   1095
  349.       Left            =   4680
  350.       Picture         =   "Sample.frx":0000
  351.       Stretch         =   -1  'True
  352.       Top             =   1560
  353.       Visible         =   0   'False
  354.       Width           =   1335
  355.    End
  356.    Begin VB.Image imgBaseball 
  357.       Height          =   1095
  358.       Left            =   3240
  359.       Picture         =   "Sample.frx":08A2
  360.       Stretch         =   -1  'True
  361.       Top             =   1560
  362.       Visible         =   0   'False
  363.       Width           =   1335
  364.    End
  365.    Begin VB.Image imgTruck 
  366.       Height          =   1095
  367.       Left            =   3240
  368.       Picture         =   "Sample.frx":1AA4
  369.       Stretch         =   -1  'True
  370.       Top             =   240
  371.       Visible         =   0   'False
  372.       Width           =   1335
  373.    End
  374.    Begin VB.Image imgCard 
  375.       Height          =   1095
  376.       Left            =   1800
  377.       Picture         =   "Sample.frx":3AE6
  378.       Stretch         =   -1  'True
  379.       Top             =   1560
  380.       Visible         =   0   'False
  381.       Width           =   1335
  382.    End
  383.    Begin VB.Image imgHouse 
  384.       Height          =   1095
  385.       Left            =   4680
  386.       Picture         =   "Sample.frx":4888
  387.       Stretch         =   -1  'True
  388.       Top             =   240
  389.       Visible         =   0   'False
  390.       Width           =   1335
  391.    End
  392.    Begin VB.Image imgCar 
  393.       Height          =   1095
  394.       Left            =   1800
  395.       Picture         =   "Sample.frx":4F2A
  396.       Stretch         =   -1  'True
  397.       Top             =   240
  398.       Visible         =   0   'False
  399.       Width           =   1335
  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 chkBaseball_Click()
  407. If chkBaseball.Value = vbChecked Then
  408.   imgBaseball.Visible = True
  409.   imgBaseball.Visible = False
  410. End If
  411. End Sub
  412. Private Sub chkCar_Click()
  413. If chkCar.Value = vbChecked Then
  414.   imgcar.Visible = True
  415.   imgcar.Visible = False
  416. End If
  417. End Sub
  418. Private Sub chkCard_Click()
  419. If chkCard.Value = vbChecked Then
  420.   imgCard.Visible = True
  421.   imgCard.Visible = False
  422. End If
  423. End Sub
  424. Private Sub chkFootball_Click()
  425. If chkFootball.Value = vbChecked Then
  426.   imgFootball.Visible = True
  427.   imgFootball.Visible = False
  428. End If
  429. End Sub
  430. Private Sub chkHouse_Click()
  431. If chkHouse.Value = vbChecked Then
  432.   imgHouse.Visible = True
  433.   imgHouse.Visible = False
  434. End If
  435. End Sub
  436. Private Sub chkTruck_Click()
  437. If chkTruck.Value = vbChecked Then
  438.   imgTruck.Visible = True
  439.   imgTruck.Visible = False
  440. End If
  441. End Sub
  442. Private Sub cmdBall_Click()
  443. If timBall.Enabled = True Then
  444.   timBall.Enabled = False
  445.   cmdBall.Caption = "Start"
  446.   timBall.Enabled = True
  447.   cmdBall.Caption = "Stop"
  448. End If
  449. End Sub
  450. Private Sub cmdBeep_Click()
  451. End Sub
  452. Private Sub Form_Load()
  453. optBlue.Value = True
  454. frmSample.BackColor = vbBlue
  455. BallY = picBall.ScaleHeight - shpBall.Height
  456. shpBall.Top = BallY
  457. BallDir = -1
  458. End Sub
  459. Private Sub hsbPick_Change()
  460. lblPick.Caption = Str(hsbPick.Value)
  461. End Sub
  462. Private Sub hsbPick_Scroll()
  463. lblPick.Caption = Str(hsbPick.Value)
  464. End Sub
  465. Private Sub optBlack_Click()
  466. frmSample.BackColor = vbBlack
  467. End Sub
  468. Private Sub optBlue_Click()
  469. frmSample.BackColor = vbBlue
  470. End Sub
  471. Private Sub optGreen_Click()
  472. frmSample.BackColor = vbGreen
  473. End Sub
  474. Private Sub optRed_Click()
  475. frmSample.BackColor = vbRed
  476. End Sub
  477. Private Sub timBall_Timer()
  478. BallY = BallY + BallDir * picBall.ScaleHeight / 50
  479. If BallY < 0 Then
  480.   Beep
  481.   BallY = 0
  482.   BallDir = 1
  483. ElseIf BallY > picBall.ScaleHeight - shpBall.Height Then
  484.   Beep
  485.   BallY = picBall.ScaleHeight - shpBall.Height
  486.   BallDir = -1
  487. End If
  488. shpBall.Top = BallY
  489. End Sub
  490.