?? frmmain.frm
字號:
VERSION 5.00
Begin VB.Form frmMain
BackColor = &H00FF0000&
Caption = "Main"
ClientHeight = 5985
ClientLeft = 1740
ClientTop = 2340
ClientWidth = 6855
ForeColor = &H00FF0000&
LinkTopic = "Form1"
ScaleHeight = 5985
ScaleWidth = 6855
Begin VB.CommandButton cmdExit
Caption = "&Exit"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4200
TabIndex = 3
ToolTipText = "Quit the program?"
Top = 4680
Width = 1335
End
Begin VB.CommandButton cmdSignup
Caption = "Sign up!"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 2
ToolTipText = "New member sign up?"
Top = 4680
Width = 1335
End
Begin VB.CommandButton cmdlogin
Caption = "Log in"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4440
TabIndex = 1
ToolTipText = "Log in after entering the User-Id"
Top = 3240
Width = 1095
End
Begin VB.TextBox txtlogin
DataField = "Name"
Height = 405
Left = 2040
TabIndex = 0
ToolTipText = "Please enter User-Id/Name"
Top = 3240
Width = 2055
End
Begin VB.Label Label6
Alignment = 2 'Center
BackColor = &H00FF0000&
Caption = "Millenium Video Store"
BeginProperty Font
Name = "Times New Roman"
Size = 26.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 1215
Left = 1080
TabIndex = 6
Top = 480
Width = 4815
End
Begin VB.Label Label1
Alignment = 2 'Center
BackColor = &H00FF0000&
Caption = "Point-of-sale system"
BeginProperty Font
Name = "Times New Roman"
Size = 26.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 615
Left = 1320
TabIndex = 5
Top = 1680
Width = 4695
End
Begin VB.Label Label2
BackColor = &H00FF0000&
Caption = "User-Id:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 4
Top = 3240
Width = 1095
End
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuExit
Caption = "E&xit"
Shortcut = +{F4}
End
End
Begin VB.Menu mnuFunction
Caption = "&Function"
Begin VB.Menu mnuRentVideo
Caption = "Rent Video"
End
Begin VB.Menu mnuReturnVideo
Caption = "Return Video"
End
Begin VB.Menu mnuReserveVideo
Caption = "Reserve Video"
End
End
Begin VB.Menu mnuHelp
Caption = "&Help"
Begin VB.Menu mnuMVS
Caption = "&About Millennium Video Store"
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdexit_Click()
Dim ans As Integer
ans = MsgBox("Do you really want to quit?", vbYesNo)
If ans = vbYes Then End
End Sub
Private Sub cmdLogin_Click()
If Len(Trim$(txtlogin.Text)) = 0 Then
MsgBox " Please enter member Id/Name "
Else
MemberLogIn
End If
End Sub
Private Sub cmdSignup_Click()
Unload Me
frmSignup.Show
End Sub
Private Sub mnuExit_Click()
Dim ans As Integer
ans = MsgBox("Do you really want to quit?", vbYesNo)
If ans = vbYes Then End
End Sub
Private Sub MemberLogIn()
Dim Login_Id As Long, strId As String
Dim varData() As Variant
strId = txtlogin.Text
If Len(strId) > 0 Then
Login_Id = RunSelectQuery("select ID,Name,Address,PostalCode,Phone,TapesRented,TapesReserved from Members " _
& "where ID = " & strId & " ", varData)
Unload Me
frmVerify.Show
frmChoices.cmdVerify.Visible = True
If Login_Id = 0 Then
frmVerify.Hide
frmMain.Show
MsgBox "No such member."
Else
frmVerify.txtverifyField(0).Text = ConvertToString(varData(0, 0)) 'Name
frmVerify.txtverifyField(1).Text = ConvertToString(varData(1, 0)) 'Name
frmVerify.txtverifyField(2).Text = ConvertToString(varData(2, 0)) 'Address
frmVerify.txtverifyField(3).Text = ConvertToString(varData(3, 0)) 'PostalCode
frmVerify.txtverifyField(4).Text = ConvertToString(varData(4, 0)) 'Telephone no.
frmVerify.txtverifyField(5).Text = ConvertToString(varData(5, 0)) 'TapeRented
frmVerify.txtverifyField(6).Text = ConvertToString(varData(6, 0)) 'TapeReserved
End If
End If
End Sub
Private Sub mnuReserveVideo_Click()
Unload Me
frmReserve.cmdLogin.Visible = True
frmReserve.txtId.Visible = True
frmReserve.label1.Visible = True
frmReserve.Show
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -