home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD1243.psc / Source / TrainInputWindow.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-08-10  |  7.1 KB  |  216 lines

  1. VERSION 5.00
  2. Begin VB.Form InputWindow 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Congratulations You Have The New High Score"
  5.    ClientHeight    =   3195
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   4680
  9.    ClipControls    =   0   'False
  10.    ControlBox      =   0   'False
  11.    Icon            =   "TrainInputWindow.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    Moveable        =   0   'False
  16.    ScaleHeight     =   3195
  17.    ScaleWidth      =   4680
  18.    StartUpPosition =   2  'CenterScreen
  19.    Begin VB.TextBox NewName 
  20.       Height          =   330
  21.       Left            =   135
  22.       TabIndex        =   1
  23.       Top             =   2160
  24.       Width           =   4380
  25.    End
  26.    Begin VB.Label Label4 
  27.       Alignment       =   2  'Center
  28.       AutoSize        =   -1  'True
  29.       BackStyle       =   0  'Transparent
  30.       Caption         =   "Cancel"
  31.       BeginProperty Font 
  32.          Name            =   "Times New Roman"
  33.          Size            =   20.25
  34.          Charset         =   0
  35.          Weight          =   400
  36.          Underline       =   0   'False
  37.          Italic          =   0   'False
  38.          Strikethrough   =   0   'False
  39.       EndProperty
  40.       ForeColor       =   &H00008000&
  41.       Height          =   465
  42.       Left            =   2790
  43.       TabIndex        =   4
  44.       Top             =   2610
  45.       Width           =   1155
  46.    End
  47.    Begin VB.Label Label3 
  48.       Alignment       =   2  'Center
  49.       AutoSize        =   -1  'True
  50.       BackStyle       =   0  'Transparent
  51.       Caption         =   "OK"
  52.       BeginProperty Font 
  53.          Name            =   "Times New Roman"
  54.          Size            =   20.25
  55.          Charset         =   0
  56.          Weight          =   400
  57.          Underline       =   0   'False
  58.          Italic          =   0   'False
  59.          Strikethrough   =   0   'False
  60.       EndProperty
  61.       ForeColor       =   &H00008000&
  62.       Height          =   465
  63.       Left            =   705
  64.       TabIndex        =   3
  65.       Top             =   2610
  66.       Width           =   585
  67.    End
  68.    Begin VB.Label Label2 
  69.       BackStyle       =   0  'Transparent
  70.       Caption         =   "Enter Your Name:"
  71.       BeginProperty Font 
  72.          Name            =   "Times New Roman"
  73.          Size            =   9.75
  74.          Charset         =   0
  75.          Weight          =   700
  76.          Underline       =   0   'False
  77.          Italic          =   0   'False
  78.          Strikethrough   =   0   'False
  79.       EndProperty
  80.       ForeColor       =   &H00FFFF00&
  81.       Height          =   240
  82.       Left            =   135
  83.       TabIndex        =   2
  84.       Top             =   1845
  85.       Width           =   1500
  86.    End
  87.    Begin VB.Label Title 
  88.       Alignment       =   2  'Center
  89.       BackStyle       =   0  'Transparent
  90.       Caption         =   "You Have Betten The High Score For Quad-Ball !"
  91.       BeginProperty Font 
  92.          Name            =   "Times New Roman"
  93.          Size            =   24
  94.          Charset         =   0
  95.          Weight          =   700
  96.          Underline       =   0   'False
  97.          Italic          =   0   'False
  98.          Strikethrough   =   0   'False
  99.       EndProperty
  100.       ForeColor       =   &H0000FFFF&
  101.       Height          =   1635
  102.       Left            =   45
  103.       TabIndex        =   0
  104.       Top             =   -45
  105.       Width           =   4515
  106.    End
  107. Attribute VB_Name = "InputWindow"
  108. Attribute VB_GlobalNameSpace = False
  109. Attribute VB_Creatable = False
  110. Attribute VB_PredeclaredId = True
  111. Attribute VB_Exposed = False
  112. 'This Form Is Like The "INPUT WINDOW 2" but Is Used For High Scores '
  113. '___________________________________________________________________'
  114. Private Sub Form_Load()
  115.  InputLoaded = True
  116.  Call Set_Mouse_X_Y(Me.Left / Screen.TwipsPerPixelX + 100, Me.Top / Screen.TwipsPerPixelY + 100)
  117.  ExitInputWindow = False
  118.  Me.Picture = ParentForm.StatBox.Picture
  119.  Me.Show
  120.  Me.Refresh
  121.  LimitMovement
  122. End Sub
  123. Private Sub LimitMovement() ' Stops Mouse Leaving Form
  124.   If ExitMouse = True Then GoTo nd:
  125.   If ExitInputWindow = True Then GoTo nd:
  126.   Me.ZOrder 0
  127.   DoEvents
  128.   KeepMouseOnForm
  129.  Loop Until ExitMouse = True
  130. Unload Me
  131. End Sub
  132. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  133.  InputLoaded = False
  134.  ExitMouse = True
  135.  ExitInputWindow = True
  136. End Sub
  137. Private Sub Form_Unload(Cancel As Integer)
  138.  InputLoaded = False
  139. End Sub
  140. Private Sub Label3_Click()
  141.  Call SaveScoreTraining(NewName.Text, ParentForm.Score.Caption)
  142.  Unload Me
  143. End Sub
  144. Private Sub Label3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  145. 'sub highlights the lables the mouse moves over
  146.  If Label3.Tag = "yes" Then Exit Sub
  147.  Label3.Tag = "yes"
  148.  If Label4.Tag = " yes" Then
  149.   Label4.ForeColor = RGB(0, 90, 0)
  150.   Label4.Top = Label4.Top + 50
  151.   Label4.FontSize = Label4.FontSize - 5
  152.   Label4.Tag = "no"
  153.  End If
  154.  WAVPlay "click.qbs"
  155.  Label3.Top = Label3.Top - 50
  156.  Label3.ForeColor = RGB(0, 255, 0)
  157.  Label3.FontSize = Label3.FontSize + 5
  158.  End Sub
  159. Private Sub Label4_Click()
  160.  Dim Result As VbMsgBoxResult
  161.  Result = MsgBox("Are You Sure?, If You Click OK Your New Top Score Will not Be Saved!", vbOKCancel, "Confirmation")
  162.  If Result = vbCancel Then
  163.   Exit Sub
  164.  Else
  165.   ExitMouse = True
  166.   Unload Me
  167.  End If
  168. End Sub
  169. Private Sub Label4_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  170. 'sub highlights the lables the mouse moves over
  171.  If Label4.Tag = "yes" Then Exit Sub
  172.  Label4.Tag = "yes"
  173.  If Label3.Tag = " yes" Then
  174.   Label3.ForeColor = RGB(0, 90, 0)
  175.   Label3.Top = Label3.Top + 50
  176.   Label3.FontSize = Label3.FontSize - 5
  177.   Label3.Tag = "no"
  178.  End If
  179.  WAVPlay "click.qbs"
  180.  Label4.ForeColor = RGB(0, 255, 0)
  181.  Label4.Top = Label4.Top - 50
  182.  Label4.FontSize = Label4.FontSize + 5
  183.  End Sub
  184. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  185.  'sub unghlights the lables
  186.  If Label4.Tag = "yes" Then
  187.   Label4.ForeColor = RGB(0, 90, 0)
  188.   Label4.Top = Label4.Top + 50
  189.   Label4.FontSize = Label4.FontSize - 5
  190.   Label4.Tag = "no"
  191.  End If
  192.  If Label3.Tag = "yes" Then
  193.   Label3.ForeColor = RGB(0, 90, 0)
  194.   Label3.Top = Label3.Top + 50
  195.   Label3.FontSize = Label3.FontSize - 5
  196.   Label3.Tag = "no"
  197.  End If
  198.  Label4.ForeColor = RGB(0, 90, 0)
  199.  Label3.ForeColor = RGB(0, 90, 0)
  200. End Sub
  201. Private Sub KeepMouseOnForm()
  202. 'Used to Control Mouse
  203. If ExitMouse = True Or ExitInputWindow = True Then GoTo nd:
  204. Me.ZOrder 0
  205. If Get_Mouse_X >= Int((Me.Left + Me.Width) _
  206.  / Screen.TwipsPerPixelX) - 5 Then _
  207.  Set_Mouse_X ((Me.Left + Me.Width) / Screen.TwipsPerPixelX) - 5
  208. If Get_Mouse_X <= Int((Me.Left) _
  209.  / Screen.TwipsPerPixelX) Then _
  210.  Set_Mouse_X ((Me.Left) / Screen.TwipsPerPixelX) + 5
  211. If Get_Mouse_Y <= Int(Me.Top / Screen.TwipsPerPixelY) + 5 Then _
  212.  Set_Mouse_Y (Me.Top / Screen.TwipsPerPixelY) + 5
  213. If Get_Mouse_Y >= Int((Me.Top + Me.Height) / Screen.TwipsPerPixelY) - 5 Then _
  214.  Set_Mouse_Y ((Me.Top + Me.Height) / Screen.TwipsPerPixelY) - 5
  215. End Sub
  216.