home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / yahtze1a / frmhighs.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-26  |  16.9 KB  |  503 lines

  1. VERSION 5.00
  2. Begin VB.Form frmHighScore 
  3.    BackColor       =   &H00FFFFFF&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "High Score"
  6.    ClientHeight    =   3435
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   3825
  10.    ControlBox      =   0   'False
  11.    ForeColor       =   &H00000000&
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    Picture         =   "frmHighScore.frx":0000
  17.    ScaleHeight     =   3435
  18.    ScaleWidth      =   3825
  19.    ShowInTaskbar   =   0   'False
  20.    StartUpPosition =   1  'CenterOwner
  21.    Begin VB.Timer Timer1 
  22.       Enabled         =   0   'False
  23.       Interval        =   5
  24.       Left            =   1725
  25.       Top             =   1140
  26.    End
  27.    Begin VB.Image imgReset 
  28.       Height          =   330
  29.       Left            =   360
  30.       Picture         =   "frmHighScore.frx":1EB52
  31.       Top             =   3000
  32.       Width           =   1095
  33.    End
  34.    Begin VB.Image imgOK 
  35.       Height          =   330
  36.       Left            =   2340
  37.       Picture         =   "frmHighScore.frx":1EE3F
  38.       Top             =   3000
  39.       Width           =   1095
  40.    End
  41.    Begin VB.Label lbl1 
  42.       Appearance      =   0  'Flat
  43.       AutoSize        =   -1  'True
  44.       BackColor       =   &H80000005&
  45.       BackStyle       =   0  'Transparent
  46.       Caption         =   "5.)"
  47.       BeginProperty Font 
  48.          Name            =   "MS Sans Serif"
  49.          Size            =   8.25
  50.          Charset         =   0
  51.          Weight          =   700
  52.          Underline       =   0   'False
  53.          Italic          =   0   'False
  54.          Strikethrough   =   0   'False
  55.       EndProperty
  56.       ForeColor       =   &H80000008&
  57.       Height          =   195
  58.       Index           =   4
  59.       Left            =   120
  60.       TabIndex        =   16
  61.       Top             =   2640
  62.       Width           =   240
  63.    End
  64.    Begin VB.Label lbl1 
  65.       Appearance      =   0  'Flat
  66.       AutoSize        =   -1  'True
  67.       BackColor       =   &H80000005&
  68.       BackStyle       =   0  'Transparent
  69.       Caption         =   "4.)"
  70.       BeginProperty Font 
  71.          Name            =   "MS Sans Serif"
  72.          Size            =   8.25
  73.          Charset         =   0
  74.          Weight          =   700
  75.          Underline       =   0   'False
  76.          Italic          =   0   'False
  77.          Strikethrough   =   0   'False
  78.       EndProperty
  79.       ForeColor       =   &H80000008&
  80.       Height          =   195
  81.       Index           =   3
  82.       Left            =   120
  83.       TabIndex        =   15
  84.       Top             =   2310
  85.       Width           =   240
  86.    End
  87.    Begin VB.Label lbl1 
  88.       Appearance      =   0  'Flat
  89.       AutoSize        =   -1  'True
  90.       BackColor       =   &H80000005&
  91.       BackStyle       =   0  'Transparent
  92.       Caption         =   "3.)"
  93.       BeginProperty Font 
  94.          Name            =   "MS Sans Serif"
  95.          Size            =   8.25
  96.          Charset         =   0
  97.          Weight          =   700
  98.          Underline       =   0   'False
  99.          Italic          =   0   'False
  100.          Strikethrough   =   0   'False
  101.       EndProperty
  102.       ForeColor       =   &H80000008&
  103.       Height          =   195
  104.       Index           =   2
  105.       Left            =   120
  106.       TabIndex        =   14
  107.       Top             =   1980
  108.       Width           =   240
  109.    End
  110.    Begin VB.Label lbl1 
  111.       Appearance      =   0  'Flat
  112.       AutoSize        =   -1  'True
  113.       BackColor       =   &H80000005&
  114.       BackStyle       =   0  'Transparent
  115.       Caption         =   "2.)"
  116.       BeginProperty Font 
  117.          Name            =   "MS Sans Serif"
  118.          Size            =   8.25
  119.          Charset         =   0
  120.          Weight          =   700
  121.          Underline       =   0   'False
  122.          Italic          =   0   'False
  123.          Strikethrough   =   0   'False
  124.       EndProperty
  125.       ForeColor       =   &H80000008&
  126.       Height          =   195
  127.       Index           =   1
  128.       Left            =   120
  129.       TabIndex        =   13
  130.       Top             =   1650
  131.       Width           =   240
  132.    End
  133.    Begin VB.Label labS1 
  134.       Appearance      =   0  'Flat
  135.       AutoSize        =   -1  'True
  136.       BackColor       =   &H80000005&
  137.       BackStyle       =   0  'Transparent
  138.       Caption         =   "Score 5"
  139.       BeginProperty Font 
  140.          Name            =   "MS Sans Serif"
  141.          Size            =   8.25
  142.          Charset         =   0
  143.          Weight          =   700
  144.          Underline       =   0   'False
  145.          Italic          =   0   'False
  146.          Strikethrough   =   0   'False
  147.       EndProperty
  148.       ForeColor       =   &H00C000C0&
  149.       Height          =   195
  150.       Index           =   4
  151.       Left            =   2760
  152.       TabIndex        =   12
  153.       Top             =   2640
  154.       Width           =   675
  155.    End
  156.    Begin VB.Label labS1 
  157.       Appearance      =   0  'Flat
  158.       AutoSize        =   -1  'True
  159.       BackColor       =   &H80000005&
  160.       BackStyle       =   0  'Transparent
  161.       Caption         =   "Score 4"
  162.       BeginProperty Font 
  163.          Name            =   "MS Sans Serif"
  164.          Size            =   8.25
  165.          Charset         =   0
  166.          Weight          =   700
  167.          Underline       =   0   'False
  168.          Italic          =   0   'False
  169.          Strikethrough   =   0   'False
  170.       EndProperty
  171.       ForeColor       =   &H00C000C0&
  172.       Height          =   195
  173.       Index           =   3
  174.       Left            =   2760
  175.       TabIndex        =   11
  176.       Top             =   2310
  177.       Width           =   675
  178.    End
  179.    Begin VB.Label labS1 
  180.       Appearance      =   0  'Flat
  181.       AutoSize        =   -1  'True
  182.       BackColor       =   &H80000005&
  183.       BackStyle       =   0  'Transparent
  184.       Caption         =   "Score 3"
  185.       BeginProperty Font 
  186.          Name            =   "MS Sans Serif"
  187.          Size            =   8.25
  188.          Charset         =   0
  189.          Weight          =   700
  190.          Underline       =   0   'False
  191.          Italic          =   0   'False
  192.          Strikethrough   =   0   'False
  193.       EndProperty
  194.       ForeColor       =   &H00C000C0&
  195.       Height          =   195
  196.       Index           =   2
  197.       Left            =   2760
  198.       TabIndex        =   10
  199.       Top             =   1980
  200.       Width           =   675
  201.    End
  202.    Begin VB.Label labS1 
  203.       Appearance      =   0  'Flat
  204.       AutoSize        =   -1  'True
  205.       BackColor       =   &H80000005&
  206.       BackStyle       =   0  'Transparent
  207.       Caption         =   "Score 2"
  208.       BeginProperty Font 
  209.          Name            =   "MS Sans Serif"
  210.          Size            =   8.25
  211.          Charset         =   0
  212.          Weight          =   700
  213.          Underline       =   0   'False
  214.          Italic          =   0   'False
  215.          Strikethrough   =   0   'False
  216.       EndProperty
  217.       ForeColor       =   &H00C000C0&
  218.       Height          =   195
  219.       Index           =   1
  220.       Left            =   2760
  221.       TabIndex        =   9
  222.       Top             =   1650
  223.       Width           =   675
  224.    End
  225.    Begin VB.Label labP1 
  226.       Appearance      =   0  'Flat
  227.       BackColor       =   &H80000005&
  228.       BackStyle       =   0  'Transparent
  229.       Caption         =   "Player 5"
  230.       BeginProperty Font 
  231.          Name            =   "MS Sans Serif"
  232.          Size            =   8.25
  233.          Charset         =   0
  234.          Weight          =   700
  235.          Underline       =   0   'False
  236.          Italic          =   0   'False
  237.          Strikethrough   =   0   'False
  238.       EndProperty
  239.       ForeColor       =   &H00FF0000&
  240.       Height          =   195
  241.       Index           =   4
  242.       Left            =   480
  243.       TabIndex        =   8
  244.       Top             =   2640
  245.       Width           =   2085
  246.    End
  247.    Begin VB.Label labP1 
  248.       Appearance      =   0  'Flat
  249.       BackColor       =   &H80000005&
  250.       BackStyle       =   0  'Transparent
  251.       Caption         =   "Player 4"
  252.       BeginProperty Font 
  253.          Name            =   "MS Sans Serif"
  254.          Size            =   8.25
  255.          Charset         =   0
  256.          Weight          =   700
  257.          Underline       =   0   'False
  258.          Italic          =   0   'False
  259.          Strikethrough   =   0   'False
  260.       EndProperty
  261.       ForeColor       =   &H00FF0000&
  262.       Height          =   195
  263.       Index           =   3
  264.       Left            =   480
  265.       TabIndex        =   7
  266.       Top             =   2310
  267.       Width           =   2085
  268.    End
  269.    Begin VB.Label labP1 
  270.       Appearance      =   0  'Flat
  271.       BackColor       =   &H80000005&
  272.       BackStyle       =   0  'Transparent
  273.       Caption         =   "Player 3"
  274.       BeginProperty Font 
  275.          Name            =   "MS Sans Serif"
  276.          Size            =   8.25
  277.          Charset         =   0
  278.          Weight          =   700
  279.          Underline       =   0   'False
  280.          Italic          =   0   'False
  281.          Strikethrough   =   0   'False
  282.       EndProperty
  283.       ForeColor       =   &H00FF0000&
  284.       Height          =   195
  285.       Index           =   2
  286.       Left            =   480
  287.       TabIndex        =   6
  288.       Top             =   1980
  289.       Width           =   2085
  290.    End
  291.    Begin VB.Label labP1 
  292.       Appearance      =   0  'Flat
  293.       BackColor       =   &H80000005&
  294.       BackStyle       =   0  'Transparent
  295.       Caption         =   "Player 2"
  296.       BeginProperty Font 
  297.          Name            =   "MS Sans Serif"
  298.          Size            =   8.25
  299.          Charset         =   0
  300.          Weight          =   700
  301.          Underline       =   0   'False
  302.          Italic          =   0   'False
  303.          Strikethrough   =   0   'False
  304.       EndProperty
  305.       ForeColor       =   &H00FF0000&
  306.       Height          =   195
  307.       Index           =   1
  308.       Left            =   480
  309.       TabIndex        =   5
  310.       Top             =   1650
  311.       Width           =   2085
  312.    End
  313.    Begin VB.Label Label3 
  314.       Appearance      =   0  'Flat
  315.       AutoSize        =   -1  'True
  316.       BackColor       =   &H80000005&
  317.       Caption         =   "SCORE"
  318.       BeginProperty Font 
  319.          Name            =   "MS Sans Serif"
  320.          Size            =   8.25
  321.          Charset         =   0
  322.          Weight          =   700
  323.          Underline       =   0   'False
  324.          Italic          =   0   'False
  325.          Strikethrough   =   0   'False
  326.       EndProperty
  327.       ForeColor       =   &H80000008&
  328.       Height          =   195
  329.       Left            =   2760
  330.       TabIndex        =   4
  331.       Top             =   1080
  332.       Width           =   645
  333.    End
  334.    Begin VB.Label lbl1 
  335.       Appearance      =   0  'Flat
  336.       AutoSize        =   -1  'True
  337.       BackColor       =   &H80000005&
  338.       BackStyle       =   0  'Transparent
  339.       Caption         =   "1.)"
  340.       BeginProperty Font 
  341.          Name            =   "MS Sans Serif"
  342.          Size            =   8.25
  343.          Charset         =   0
  344.          Weight          =   700
  345.          Underline       =   0   'False
  346.          Italic          =   0   'False
  347.          Strikethrough   =   0   'False
  348.       EndProperty
  349.       ForeColor       =   &H80000008&
  350.       Height          =   195
  351.       Index           =   0
  352.       Left            =   120
  353.       TabIndex        =   3
  354.       Top             =   1320
  355.       Width           =   240
  356.    End
  357.    Begin VB.Label labS1 
  358.       Appearance      =   0  'Flat
  359.       AutoSize        =   -1  'True
  360.       BackColor       =   &H80000005&
  361.       BackStyle       =   0  'Transparent
  362.       Caption         =   "Score 1"
  363.       BeginProperty Font 
  364.          Name            =   "MS Sans Serif"
  365.          Size            =   8.25
  366.          Charset         =   0
  367.          Weight          =   700
  368.          Underline       =   0   'False
  369.          Italic          =   0   'False
  370.          Strikethrough   =   0   'False
  371.       EndProperty
  372.       ForeColor       =   &H00C000C0&
  373.       Height          =   195
  374.       Index           =   0
  375.       Left            =   2760
  376.       TabIndex        =   2
  377.       Top             =   1320
  378.       Width           =   675
  379.    End
  380.    Begin VB.Label labP1 
  381.       Appearance      =   0  'Flat
  382.       BackColor       =   &H80000005&
  383.       BackStyle       =   0  'Transparent
  384.       Caption         =   "Player 1"
  385.       BeginProperty Font 
  386.          Name            =   "MS Sans Serif"
  387.          Size            =   8.25
  388.          Charset         =   0
  389.          Weight          =   700
  390.          Underline       =   0   'False
  391.          Italic          =   0   'False
  392.          Strikethrough   =   0   'False
  393.       EndProperty
  394.       ForeColor       =   &H00FF0000&
  395.       Height          =   195
  396.       Index           =   0
  397.       Left            =   480
  398.       TabIndex        =   1
  399.       Top             =   1320
  400.       Width           =   2085
  401.    End
  402.    Begin VB.Line Line1 
  403.       X1              =   1250
  404.       X2              =   3775
  405.       Y1              =   840
  406.       Y2              =   840
  407.    End
  408.    Begin VB.Label lblBestPlayers 
  409.       Alignment       =   2  'Center
  410.       Appearance      =   0  'Flat
  411.       BackColor       =   &H80000005&
  412.       Caption         =   "Best Players Of All Time"
  413.       BeginProperty Font 
  414.          Name            =   "MS Sans Serif"
  415.          Size            =   8.25
  416.          Charset         =   0
  417.          Weight          =   700
  418.          Underline       =   0   'False
  419.          Italic          =   0   'False
  420.          Strikethrough   =   0   'False
  421.       EndProperty
  422.       ForeColor       =   &H80000008&
  423.       Height          =   375
  424.       Left            =   1320
  425.       TabIndex        =   0
  426.       Top             =   600
  427.       Width           =   2415
  428.    End
  429. Attribute VB_Name = "frmHighScore"
  430. Attribute VB_GlobalNameSpace = False
  431. Attribute VB_Creatable = False
  432. Attribute VB_PredeclaredId = True
  433. Attribute VB_Exposed = False
  434. Option Explicit
  435. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
  436.   '//User pressed the escape key
  437.   If KeyCode = vbKeyEscape Then Unload Me
  438. End Sub
  439. Private Sub Form_Load()
  440. Dim i As Integer
  441.   '//Get highscores
  442.   Call GetScores
  443.   For i = 0 To 4 '//Move high scores name text off of form
  444.    labP1(i).Left = -1500
  445.    lbl1(i).Left = -1860
  446.   Next i
  447.   Timer1.Enabled = True '//Enable timer so they can start moving into view
  448. End Sub
  449. Private Sub Timer1_Timer()
  450. Dim i As Integer
  451.   For i = 0 To 4
  452.    lbl1(i).Left = lbl1(i).Left + 120 '//Move player rank numbers in
  453.    labP1(i).Left = labP1(i).Left + 120 '//Move player names in
  454.    '//They are in place, stop timer and exit timer sub
  455.    If labP1(4).Left >= 480 Then Timer1.Enabled = False: Exit Sub
  456.   Next i
  457. End Sub
  458. Private Sub imgOK_Click()
  459.   '//Unload form
  460.   Unload Me
  461. End Sub
  462. Private Sub imgOK_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  463.   '//Change picture on mouse down
  464.   imgOK.Picture = frmMain.ImageList1.ListImages(4).Picture
  465. End Sub
  466. Private Sub imgOK_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  467.   '//Reset picture on mouse up
  468.   imgOK.Picture = frmMain.ImageList1.ListImages(3).Picture
  469. End Sub
  470. Private Sub imgReset_Click()
  471.   '//Reset high scores
  472.   Call ResetHighScores
  473.   '//Get scores again to set the current screen to correct scores in registry
  474.   Call GetScores
  475. End Sub
  476. Private Sub imgReset_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  477.   '//Change picture on mouse down
  478.   imgReset.Picture = frmMain.ImageList1.ListImages(6).Picture
  479. End Sub
  480. Private Sub imgReset_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  481.   '//Reset picture on mouse up
  482.   imgReset.Picture = frmMain.ImageList1.ListImages(5).Picture
  483. End Sub
  484. Private Sub GetScores()
  485.   '//Get all high scores from registry
  486.   labP1(0).Caption = GetSetting(MyApp, "Settings", "HSName0", "Default")
  487.   labP1(1).Caption = GetSetting(MyApp, "Settings", "HSName1", "Default")
  488.   labP1(2).Caption = GetSetting(MyApp, "Settings", "HSName2", "Default")
  489.   labP1(3).Caption = GetSetting(MyApp, "Settings", "HSName3", "Default")
  490.   labP1(4).Caption = GetSetting(MyApp, "Settings", "HSName4", "Default")
  491.   labS1(0).Caption = GetSetting(MyApp, "Settings", "HSScore0", "Default")
  492.   labS1(1).Caption = GetSetting(MyApp, "Settings", "HSScore1", "Default")
  493.   labS1(2).Caption = GetSetting(MyApp, "Settings", "HSScore2", "Default")
  494.   labS1(3).Caption = GetSetting(MyApp, "Settings", "HSScore3", "Default")
  495.   labS1(4).Caption = GetSetting(MyApp, "Settings", "HSScore4", "Default")
  496.   If frmMain.pBar.Value = 13 Then '//Game is over highlight your highscore
  497.     labP1(HSPosition).FontUnderline = True
  498.     labS1(HSPosition).FontUnderline = True
  499.     labP1(HSPosition).ForeColor = &H8000&
  500.     labS1(HSPosition).ForeColor = &H8000&
  501.   End If
  502. End Sub
  503.