home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / tictac_1 / form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-05-05  |  17.6 KB  |  657 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BackColor       =   &H00FFFFFF&
  4.    BorderStyle     =   1  'Fest Einfach
  5.    Caption         =   "Tic Tac Toe"
  6.    ClientHeight    =   4812
  7.    ClientLeft      =   36
  8.    ClientTop       =   324
  9.    ClientWidth     =   5928
  10.    Icon            =   "Form1.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   4812
  15.    ScaleWidth      =   5928
  16.    StartUpPosition =   2  'Bildschirmmitte
  17.    Begin VB.Timer Timer3 
  18.       Interval        =   50
  19.       Left            =   120
  20.       Top             =   1080
  21.    End
  22.    Begin VB.Frame Frame2 
  23.       BackColor       =   &H00FFFFFF&
  24.       Caption         =   "Player O"
  25.       Height          =   1572
  26.       Left            =   4080
  27.       TabIndex        =   3
  28.       Top             =   2640
  29.       Width           =   1692
  30.       Begin VB.Label Label4 
  31.          Alignment       =   2  'Zentriert
  32.          BackColor       =   &H00FFFFFF&
  33.          Caption         =   "0"
  34.          BeginProperty Font 
  35.             Name            =   "Comic Sans MS"
  36.             Size            =   36
  37.             Charset         =   0
  38.             Weight          =   700
  39.             Underline       =   0   'False
  40.             Italic          =   0   'False
  41.             Strikethrough   =   0   'False
  42.          EndProperty
  43.          Height          =   1212
  44.          Left            =   120
  45.          TabIndex        =   5
  46.          Top             =   240
  47.          Width           =   1452
  48.       End
  49.    End
  50.    Begin VB.Frame Frame1 
  51.       BackColor       =   &H00FFFFFF&
  52.       Caption         =   "Player X"
  53.       Height          =   1572
  54.       Left            =   4080
  55.       TabIndex        =   2
  56.       Top             =   840
  57.       Width           =   1692
  58.       Begin VB.Label Label3 
  59.          Alignment       =   2  'Zentriert
  60.          BackColor       =   &H00FFFFFF&
  61.          Caption         =   "0"
  62.          BeginProperty Font 
  63.             Name            =   "Comic Sans MS"
  64.             Size            =   36
  65.             Charset         =   0
  66.             Weight          =   700
  67.             Underline       =   0   'False
  68.             Italic          =   0   'False
  69.             Strikethrough   =   0   'False
  70.          EndProperty
  71.          Height          =   1212
  72.          Left            =   120
  73.          TabIndex        =   4
  74.          Top             =   240
  75.          Width           =   1452
  76.       End
  77.    End
  78.    Begin VB.Timer Timer2 
  79.       Interval        =   50
  80.       Left            =   120
  81.       Top             =   720
  82.    End
  83.    Begin VB.Timer Timer1 
  84.       Interval        =   50
  85.       Left            =   120
  86.       Top             =   360
  87.    End
  88.    Begin VB.Label Label2 
  89.       BackColor       =   &H00FFFFFF&
  90.       Caption         =   "Masta Sky"
  91.       BeginProperty Font 
  92.          Name            =   "MS Sans Serif"
  93.          Size            =   7.8
  94.          Charset         =   0
  95.          Weight          =   400
  96.          Underline       =   -1  'True
  97.          Italic          =   0   'False
  98.          Strikethrough   =   0   'False
  99.       EndProperty
  100.       ForeColor       =   &H00FF0000&
  101.       Height          =   252
  102.       Left            =   2160
  103.       TabIndex        =   1
  104.       Top             =   4320
  105.       Width           =   1452
  106.    End
  107.    Begin VB.Label Label1 
  108.       Alignment       =   1  'Rechts
  109.       BackColor       =   &H00FFFFFF&
  110.       Caption         =   "1998 by "
  111.       Height          =   252
  112.       Left            =   600
  113.       TabIndex        =   0
  114.       Top             =   4320
  115.       Width           =   1452
  116.    End
  117.    Begin VB.Image Image10 
  118.       Height          =   612
  119.       Left            =   480
  120.       Picture         =   "Form1.frx":0442
  121.       Stretch         =   -1  'True
  122.       Top             =   120
  123.       Width           =   3372
  124.    End
  125.    Begin VB.Image Image9 
  126.       Height          =   1092
  127.       Left            =   2760
  128.       Top             =   3120
  129.       Width           =   1092
  130.    End
  131.    Begin VB.Image Image8 
  132.       Height          =   1212
  133.       Left            =   2760
  134.       Top             =   1920
  135.       Width           =   1092
  136.    End
  137.    Begin VB.Image Image7 
  138.       Height          =   1092
  139.       Left            =   2760
  140.       Top             =   840
  141.       Width           =   1092
  142.    End
  143.    Begin VB.Image Image6 
  144.       Height          =   1092
  145.       Left            =   1560
  146.       Top             =   3120
  147.       Width           =   1212
  148.    End
  149.    Begin VB.Image Image5 
  150.       Height          =   1212
  151.       Left            =   1560
  152.       Top             =   1920
  153.       Width           =   1212
  154.    End
  155.    Begin VB.Image Image4 
  156.       Height          =   1092
  157.       Left            =   1560
  158.       Top             =   840
  159.       Width           =   1212
  160.    End
  161.    Begin VB.Image Image3 
  162.       Height          =   1092
  163.       Left            =   480
  164.       Top             =   3120
  165.       Width           =   1092
  166.    End
  167.    Begin VB.Image Image2 
  168.       Height          =   1212
  169.       Left            =   480
  170.       Top             =   1920
  171.       Width           =   1092
  172.    End
  173.    Begin VB.Image Image1 
  174.       Height          =   1092
  175.       Left            =   480
  176.       Top             =   840
  177.       Width           =   1092
  178.    End
  179.    Begin VB.Image O9 
  180.       Height          =   840
  181.       Left            =   2880
  182.       Picture         =   "Form1.frx":0EE2
  183.       Stretch         =   -1  'True
  184.       Top             =   3240
  185.       Width           =   840
  186.    End
  187.    Begin VB.Image O8 
  188.       Height          =   960
  189.       Left            =   2880
  190.       Picture         =   "Form1.frx":16AF
  191.       Stretch         =   -1  'True
  192.       Top             =   2040
  193.       Width           =   840
  194.    End
  195.    Begin VB.Image O7 
  196.       Height          =   840
  197.       Left            =   2880
  198.       Picture         =   "Form1.frx":1E7C
  199.       Stretch         =   -1  'True
  200.       Top             =   960
  201.       Width           =   840
  202.    End
  203.    Begin VB.Image O6 
  204.       Height          =   840
  205.       Left            =   1680
  206.       Picture         =   "Form1.frx":2649
  207.       Stretch         =   -1  'True
  208.       Top             =   3240
  209.       Width           =   960
  210.    End
  211.    Begin VB.Image O5 
  212.       Height          =   960
  213.       Left            =   1680
  214.       Picture         =   "Form1.frx":2E16
  215.       Stretch         =   -1  'True
  216.       Top             =   2040
  217.       Width           =   960
  218.    End
  219.    Begin VB.Image O4 
  220.       Height          =   840
  221.       Left            =   1680
  222.       Picture         =   "Form1.frx":35E3
  223.       Stretch         =   -1  'True
  224.       Top             =   960
  225.       Width           =   960
  226.    End
  227.    Begin VB.Image O2 
  228.       Height          =   960
  229.       Left            =   600
  230.       Picture         =   "Form1.frx":3DB0
  231.       Stretch         =   -1  'True
  232.       Top             =   2040
  233.       Width           =   840
  234.    End
  235.    Begin VB.Image O3 
  236.       Height          =   840
  237.       Left            =   600
  238.       Picture         =   "Form1.frx":457D
  239.       Stretch         =   -1  'True
  240.       Top             =   3240
  241.       Width           =   840
  242.    End
  243.    Begin VB.Image O1 
  244.       Height          =   840
  245.       Left            =   600
  246.       Picture         =   "Form1.frx":4D4A
  247.       Stretch         =   -1  'True
  248.       Top             =   960
  249.       Width           =   840
  250.    End
  251.    Begin VB.Image X6 
  252.       Height          =   852
  253.       Left            =   1680
  254.       Picture         =   "Form1.frx":5517
  255.       Stretch         =   -1  'True
  256.       Top             =   3240
  257.       Width           =   972
  258.    End
  259.    Begin VB.Image X9 
  260.       Height          =   852
  261.       Left            =   2880
  262.       Picture         =   "Form1.frx":5D2A
  263.       Stretch         =   -1  'True
  264.       Top             =   3240
  265.       Width           =   852
  266.    End
  267.    Begin VB.Image X3 
  268.       Height          =   852
  269.       Left            =   600
  270.       Picture         =   "Form1.frx":653D
  271.       Stretch         =   -1  'True
  272.       Top             =   3240
  273.       Width           =   852
  274.    End
  275.    Begin VB.Image X5 
  276.       Height          =   972
  277.       Left            =   1680
  278.       Picture         =   "Form1.frx":6D50
  279.       Stretch         =   -1  'True
  280.       Top             =   2040
  281.       Width           =   972
  282.    End
  283.    Begin VB.Image X8 
  284.       Height          =   972
  285.       Left            =   2880
  286.       Picture         =   "Form1.frx":7563
  287.       Stretch         =   -1  'True
  288.       Top             =   2040
  289.       Width           =   852
  290.    End
  291.    Begin VB.Image X2 
  292.       Height          =   972
  293.       Left            =   600
  294.       Picture         =   "Form1.frx":7D76
  295.       Stretch         =   -1  'True
  296.       Top             =   2040
  297.       Width           =   852
  298.    End
  299.    Begin VB.Line Line4 
  300.       X1              =   480
  301.       X2              =   3840
  302.       Y1              =   3120
  303.       Y2              =   3120
  304.    End
  305.    Begin VB.Image X7 
  306.       Height          =   852
  307.       Left            =   2880
  308.       Picture         =   "Form1.frx":8589
  309.       Stretch         =   -1  'True
  310.       Top             =   960
  311.       Width           =   852
  312.    End
  313.    Begin VB.Image X1 
  314.       Height          =   852
  315.       Left            =   600
  316.       Picture         =   "Form1.frx":8D9C
  317.       Stretch         =   -1  'True
  318.       Top             =   960
  319.       Width           =   852
  320.    End
  321.    Begin VB.Line Line3 
  322.       X1              =   480
  323.       X2              =   3840
  324.       Y1              =   1920
  325.       Y2              =   1920
  326.    End
  327.    Begin VB.Image X4 
  328.       Height          =   852
  329.       Left            =   1680
  330.       Picture         =   "Form1.frx":95AF
  331.       Stretch         =   -1  'True
  332.       Top             =   960
  333.       Width           =   972
  334.    End
  335.    Begin VB.Line Line2 
  336.       X1              =   2760
  337.       X2              =   2760
  338.       Y1              =   840
  339.       Y2              =   4200
  340.    End
  341.    Begin VB.Line Line1 
  342.       X1              =   1560
  343.       X2              =   1560
  344.       Y1              =   840
  345.       Y2              =   4200
  346.    End
  347. Attribute VB_Name = "Form1"
  348. Attribute VB_GlobalNameSpace = False
  349. Attribute VB_Creatable = False
  350. Attribute VB_PredeclaredId = True
  351. Attribute VB_Exposed = False
  352. Dim sp1 As Boolean 'Player 1 Var
  353. Dim sp2 As Boolean 'Player 2 Var
  354. Dim p1p As Integer 'Player 1 Points
  355. Dim p2p As Integer 'Player 2 Points
  356. Function l
  357. sch()
  358. 'Function To Make All Fields Invisible
  359. O1.Visible = False
  360. O2.Visible = False
  361. O3.Visible = False
  362. O4.Visible = False
  363. O5.Visible = False
  364. O6.Visible = False
  365. O7.Visible = False
  366. O8.Visible = False
  367. O9.Visible = False
  368. X1.Visible = False
  369. X2.Visible = False
  370. X3.Visible = False
  371. X4.Visible = False
  372. X5.Visible = False
  373. X6.Visible = False
  374. X7.Visible = False
  375. X8.Visible = False
  376. X9.Visible = False
  377. End Function
  378. Private Sub Image1_Click()
  379. If sp1 = True And O1.Visible = False Then
  380.     X1.Visible = True
  381.     sp2 = True
  382.     sp1 = False
  383.     Exit Sub
  384. End If
  385. If sp2 = True And X1.Visible = False Then
  386.     O1.Visible = True
  387.     sp1 = True
  388.     sp2 = False
  389.     Exit Sub
  390. End If
  391. End Sub
  392. Private Sub Form_Load()
  393. 'Set Player1 Playing
  394. sp1 = True
  395. sp2 = False
  396. 'Make All Fields Invisible
  397. X1.Visible = False
  398. X2.Visible = False
  399. X3.Visible = False
  400. X4.Visible = False
  401. X5.Visible = False
  402. X6.Visible = False
  403. X7.Visible = False
  404. X8.Visible = False
  405. X9.Visible = False
  406. O1.Visible = False
  407. O2.Visible = False
  408. O3.Visible = False
  409. O4.Visible = False
  410. O5.Visible = False
  411. O6.Visible = False
  412. O7.Visible = False
  413. O8.Visible = False
  414. O9.Visible = False
  415. End Sub
  416. Private Sub Image2_Click()
  417. 'On Click Make Field Visible
  418. If sp1 = True And O2.Visible = False Then
  419.     X2.Visible = True
  420.     sp2 = True
  421.     sp1 = False
  422.     Exit Sub
  423. End If
  424. If sp2 = True And X2.Visible = False Then
  425.     O2.Visible = True
  426.     sp1 = True
  427.     sp2 = False
  428.     Exit Sub
  429. End If
  430. End Sub
  431. Private Sub Image3_Click()
  432. If sp1 = True And O3.Visible = False Then
  433.     X3.Visible = True
  434.     sp2 = True
  435.     sp1 = False
  436.     Exit Sub
  437. End If
  438. If sp2 = True And X3.Visible = False Then
  439.     O3.Visible = True
  440.     sp1 = True
  441.     sp2 = False
  442.     Exit Sub
  443. End If
  444. End Sub
  445. Private Sub Image4_Click()
  446. If sp1 = True And O4.Visible = False Then
  447.     X4.Visible = True
  448.     sp2 = True
  449.     sp1 = False
  450.     Exit Sub
  451. End If
  452. If sp2 = True And X4.Visible = False Then
  453.     O4.Visible = True
  454.     sp1 = True
  455.     sp2 = False
  456.     Exit Sub
  457. End If
  458. End Sub
  459. Private Sub Image5_Click()
  460. If sp1 = True And O5.Visible = False Then
  461.     X5.Visible = True
  462.     sp2 = True
  463.     sp1 = False
  464.     Exit Sub
  465. End If
  466. If sp2 = True And X5.Visible = False Then
  467.     O5.Visible = True
  468.     sp1 = True
  469.     sp2 = False
  470.     Exit Sub
  471. End If
  472. End Sub
  473. Private Sub Image6_Click()
  474. If sp1 = True And O6.Visible = False Then
  475.     X6.Visible = True
  476.     sp2 = True
  477.     sp1 = False
  478.     Exit Sub
  479. End If
  480. If sp2 = True And X6.Visible = False Then
  481.     O6.Visible = True
  482.     sp1 = True
  483.     sp2 = False
  484.     Exit Sub
  485. End If
  486. End Sub
  487. Private Sub Image7_Click()
  488. If sp1 = True And O7.Visible = False Then
  489.     X7.Visible = True
  490.     sp2 = True
  491.     sp1 = False
  492.     Exit Sub
  493. End If
  494. If sp2 = True And X7.Visible = False Then
  495.     O7.Visible = True
  496.     sp1 = True
  497.     sp2 = False
  498.     Exit Sub
  499. End If
  500. End Sub
  501. Private Sub Image8_Click()
  502. If sp1 = True And O8.Visible = False Then
  503.     X8.Visible = True
  504.     sp2 = True
  505.     sp1 = False
  506.     Exit Sub
  507. End If
  508. If sp2 = True And X8.Visible = False Then
  509.     O8.Visible = True
  510.     sp1 = True
  511.     sp2 = False
  512.     Exit Sub
  513. End If
  514. End Sub
  515. Private Sub Image9_Click()
  516. If sp1 = True And O9.Visible = False Then
  517.     X9.Visible = True
  518.     sp2 = True
  519.     sp1 = False
  520.     Exit Sub
  521. End If
  522. If sp2 = True And X9.Visible = False Then
  523.     O9.Visible = True
  524.     sp1 = True
  525.     sp2 = False
  526.     Exit Sub
  527. End If
  528. End Sub
  529. Private Sub Label2_Click()
  530. MsgBox "Email to MastaSky@T-Online.de", vbOKOnly, "EMail"
  531. End Sub
  532. Private Sub Timer1_Timer()
  533. If sp1 = True Then Form1.MousePointer = 2
  534. If sp2 = True Then Form1.MousePointer = 12
  535. End Sub
  536. Private Sub Timer2_Timer()
  537. 'Has Player X Won ???
  538. If X1.Visible = True And X2.Visible = True And X3.Visible = True Then
  539.     MsgBox "Player X wins", vbOKOnly, "The End"
  540.     Timer2.Enabled = False
  541.     l
  542.     p1p = p1p + 1
  543.     Timer2.Enabled = True
  544. End If
  545. If X1.Visible = True And X4.Visible = True And X7.Visible = True Then
  546.     MsgBox "Player X wins", vbOKOnly, "The End"
  547.     Timer2.Enabled = False
  548.     l
  549.     p1p = p1p + 1
  550.     Timer2.Enabled = True
  551. End If
  552. If X1.Visible = True And X5.Visible = True And X9.Visible = True Then
  553.     MsgBox "Player X wins", vbOKOnly, "The End"
  554.     Timer2.Enabled = False
  555.     l
  556.     p1p = p1p + 1
  557.     Timer2.Enabled = True
  558. End If
  559. If X2.Visible = True And X5.Visible = True And X8.Visible = True Then
  560.     MsgBox "Player X wins", vbOKOnly, "The End"
  561.     Timer2.Enabled = False
  562.     l
  563.     p1p = p1p + 1
  564.     Timer2.Enabled = True
  565. End If
  566. If X3.Visible = True And X6.Visible = True And X9.Visible = True Then
  567.     MsgBox "Player X wins", vbOKOnly, "The End"
  568.     Timer2.Enabled = False
  569.     l
  570.     p1p = p1p + 1
  571.     Timer2.Enabled = True
  572. End If
  573. If X3.Visible = True And X5.Visible = True And X7.Visible = True Then
  574.     MsgBox "Player X wins", vbOKOnly, "The End"
  575.     Timer2.Enabled = False
  576.     l
  577.     p1p = p1p + 1
  578.     Timer2.Enabled = True
  579. End If
  580. If X4.Visible = True And X5.Visible = True And X6.Visible = True Then
  581.     MsgBox "Player X wins", vbOKOnly, "The End"
  582.     Timer2.Enabled = False
  583.     l
  584.     p1p = p1p + 1
  585.     Timer2.Enabled = True
  586. End If
  587. If X7.Visible = True And X8.Visible = True And X9.Visible = True Then
  588.     MsgBox "Player X wins", vbOKOnly, "The End"
  589.     Timer2.Enabled = False
  590.     l
  591.     p1p = p1p + 1
  592.     Timer2.Enabled = True
  593. End If
  594. 'Has Player O Won ???
  595. If O1.Visible = True And O2.Visible = True And O3.Visible = True Then
  596.     MsgBox "Player O wins", vbOKOnly, "The End"
  597.     Timer2.Enabled = False
  598.     l
  599.     p2p = p2p + 1
  600.     Timer2.Enabled = True
  601. End If
  602. If O1.Visible = True And O4.Visible = True And O7.Visible = True Then
  603.     MsgBox "Player O wins", vbOKOnly, "The End"
  604.     Timer2.Enabled = False
  605.     l
  606.     p2p = p2p + 1
  607.     Timer2.Enabled = True
  608. End If
  609. If O1.Visible = True And O5.Visible = True And O9.Visible = True Then
  610.     MsgBox "Player O wins", vbOKOnly, "The End"
  611.     Timer2.Enabled = False
  612.     l
  613.     p2p = p2p + 1
  614.     Timer2.Enabled = True
  615. End If
  616. If O2.Visible = True And O5.Visible = True And O8.Visible = True Then
  617.     MsgBox "Player O wins", vbOKOnly, "The End"
  618.     Timer2.Enabled = False
  619.     l
  620.     p2p = p2p + 1
  621.     Timer2.Enabled = True
  622. End If
  623. If O3.Visible = True And O6.Visible = True And O9.Visible = True Then
  624.     MsgBox "Player O wins", vbOKOnly, "The End"
  625.     Timer2.Enabled = False
  626.     l
  627.     p2p = p2p + 1
  628.     Timer2.Enabled = True
  629. End If
  630. If O3.Visible = True And O5.Visible = True And O7.Visible = True Then
  631.     MsgBox "Player O wins", vbOKOnly, "The End"
  632.     Timer2.Enabled = False
  633.     l
  634.     p2p = p2p + 1
  635.     Timer2.Enabled = True
  636. End If
  637. If O4.Visible = True And O5.Visible = True And O6.Visible = True Then
  638.     MsgBox "Player O wins", vbOKOnly, "The End"
  639.     Timer2.Enabled = False
  640.     l
  641.     p2p = p2p + 1
  642.     Timer2.Enabled = True
  643. End If
  644. If O7.Visible = True And O8.Visible = True And O9.Visible = True Then
  645.     MsgBox "Player O wins", vbOKOnly, "The End"
  646.     Timer2.Enabled = False
  647.     l
  648.     p2p = p2p + 1
  649.     Timer2.Enabled = True
  650. End If
  651. End Sub
  652. Private Sub Timer3_Timer()
  653. 'Update Score Labels
  654. Label3.Caption = p1p
  655. Label4.Caption = p2p
  656. End Sub
  657.