⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmgsettings.frm

📁 School Library system to manage students borrowing and returning books
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmsettings 
   BackColor       =   &H80000000&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "General Settings."
   ClientHeight    =   4650
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6015
   Icon            =   "frmgsettings.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   4650
   ScaleWidth      =   6015
   Begin VB.CommandButton cmdok 
      Caption         =   "&Ok"
      Height          =   375
      Left            =   1320
      TabIndex        =   31
      Top             =   4200
      Width           =   1095
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "&Exit"
      Height          =   375
      Left            =   2520
      TabIndex        =   30
      Top             =   4200
      Width           =   1095
   End
   Begin VB.CommandButton cmdapply 
      Caption         =   "&Apply"
      Height          =   375
      Left            =   3720
      TabIndex        =   29
      Top             =   4200
      Width           =   1095
   End
   Begin VB.PictureBox SSTab1 
      BackColor       =   &H00E0E0E0&
      ForeColor       =   &H00400000&
      Height          =   4095
      Left            =   0
      ScaleHeight     =   4035
      ScaleWidth      =   5955
      TabIndex        =   0
      Top             =   0
      Width           =   6015
      Begin VB.Frame FRALOGIN 
         Caption         =   "Login"
         ForeColor       =   &H00FFFFFF&
         Height          =   2775
         Left            =   -74040
         TabIndex        =   3
         Top             =   840
         Width           =   3975
         Begin VB.CommandButton cmdcancel 
            Caption         =   "&Cancel"
            Height          =   375
            Left            =   2160
            TabIndex        =   13
            Top             =   2160
            Width           =   1215
         End
         Begin VB.CommandButton cmdvalidate 
            Caption         =   "Validate"
            Height          =   375
            Left            =   840
            TabIndex        =   12
            Top             =   2160
            Width           =   1215
         End
         Begin VB.TextBox txtnewpass 
            Height          =   285
            IMEMode         =   3  'DISABLE
            Left            =   1800
            PasswordChar    =   "*"
            TabIndex        =   11
            Top             =   1560
            Width           =   1695
         End
         Begin VB.TextBox txtnewuser 
            Height          =   285
            Left            =   1800
            TabIndex        =   10
            Top             =   1200
            Width           =   1695
         End
         Begin VB.TextBox txtoldpass 
            Height          =   285
            IMEMode         =   3  'DISABLE
            Left            =   1800
            PasswordChar    =   "*"
            TabIndex        =   7
            Top             =   840
            Width           =   1695
         End
         Begin VB.TextBox txtolduser 
            Height          =   285
            Left            =   1800
            TabIndex        =   5
            Top             =   480
            Width           =   1695
         End
         Begin VB.Label Label4 
            Caption         =   "New Password"
            Height          =   255
            Left            =   360
            TabIndex        =   9
            Top             =   1560
            Width           =   1335
         End
         Begin VB.Label Label3 
            Caption         =   "New User name"
            Height          =   255
            Left            =   360
            TabIndex        =   8
            Top             =   1200
            Width           =   1335
         End
         Begin VB.Label Label2 
            Caption         =   "Old Password"
            Height          =   255
            Left            =   360
            TabIndex        =   6
            Top             =   840
            Width           =   1335
         End
         Begin VB.Label Label1 
            Caption         =   "Old User Name"
            Height          =   255
            Left            =   360
            TabIndex        =   4
            Top             =   480
            Width           =   1335
         End
      End
      Begin VB.Frame Frame1 
         Caption         =   "Display"
         ForeColor       =   &H8000000E&
         Height          =   3135
         Left            =   360
         TabIndex        =   1
         Top             =   600
         Width           =   5175
         Begin VB.Frame Frame2 
            Caption         =   "Color"
            ForeColor       =   &H00400040&
            Height          =   2535
            Left            =   240
            TabIndex        =   2
            Top             =   480
            Width           =   4815
            Begin VB.ComboBox cbocolor 
               Height          =   315
               Index           =   4
               Left            =   2160
               TabIndex        =   28
               Top             =   1920
               Width           =   1695
            End
            Begin VB.ComboBox cbocolor 
               Height          =   315
               Index           =   3
               Left            =   2160
               TabIndex        =   27
               Top             =   1560
               Width           =   1695
            End
            Begin VB.ComboBox cbocolor 
               Height          =   315
               Index           =   2
               Left            =   2160
               TabIndex        =   26
               Top             =   1200
               Width           =   1695
            End
            Begin VB.ComboBox cbocolor 
               Height          =   315
               Index           =   1
               Left            =   2160
               TabIndex        =   25
               Top             =   840
               Width           =   1695
            End
            Begin VB.ComboBox cbocolor 
               Height          =   315
               Index           =   0
               Left            =   2160
               TabIndex        =   14
               Top             =   480
               Width           =   1695
            End
            Begin VB.Label lblc5 
               Height          =   255
               Left            =   3960
               TabIndex        =   24
               Top             =   1920
               Width           =   615
            End
            Begin VB.Label lblc4 
               Height          =   255
               Left            =   3960
               TabIndex        =   23
               Top             =   1560
               Width           =   615
            End
            Begin VB.Label lblc3 
               Height          =   255
               Left            =   3960
               TabIndex        =   22
               Top             =   1200
               Width           =   615
            End
            Begin VB.Label lblc2 
               Height          =   255
               Left            =   3960
               TabIndex        =   21
               Top             =   840
               Width           =   615
            End
            Begin VB.Label lblc1 
               Height          =   255
               Left            =   3960
               TabIndex        =   20
               Top             =   480
               Width           =   615
            End
            Begin VB.Label Label9 
               Caption         =   "User Details Form"
               Height          =   255
               Left            =   480
               TabIndex        =   19
               Top             =   1920
               Width           =   1695
            End
            Begin VB.Label Label8 
               Caption         =   "Book Info Form"
               Height          =   255
               Left            =   480
               TabIndex        =   18
               Top             =   1560
               Width           =   1695
            End
            Begin VB.Label Label7 
               Caption         =   "Borrowing Form"
               Height          =   255
               Left            =   480
               TabIndex        =   17
               Top             =   1200
               Width           =   1695
            End
            Begin VB.Label Label6 
               Caption         =   "Returning Form"
               Height          =   255
               Left            =   480
               TabIndex        =   16
               Top             =   840
               Width           =   1695
            End
            Begin VB.Label Label5 
               Caption         =   "The Main Form"
               Height          =   255
               Left            =   480
               TabIndex        =   15
               Top             =   480
               Width           =   1695
            End
         End
      End
   End
End
Attribute VB_Name = "frmsettings"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Validate As Boolean, displayn As Boolean
Public a As String, a1 As String, b As String, b1 As String, mycolor As String, returncolor As String
Dim m(4) As String

Private Sub cbocolor_click(Index As Integer)
'used to get the color selcted from the combo boxes
If cbocolor(Index) <> "" Then
displayn = True
Select Case Index
Case 0
mycolor = cbocolor(0).Text
getcolor
lblc1.BackColor = returncolor
m(0) = returncolor
Case 1
mycolor = cbocolor(1).Text
getcolor
lblc2.BackColor = returncolor
m(1) = returncolor
Case 2
mycolor = cbocolor(2).Text
getcolor
lblc3.BackColor = returncolor
m(2) = returncolor
Case 3
mycolor = cbocolor(3).Text
getcolor
lblc4.BackColor = returncolor
m(3) = returncolor
Case 4
mycolor = cbocolor(4).Text
getcolor
lblc5.BackColor = returncolor
m(4) = returncolor
End Select
Else
End If
End Sub

Private Sub cmdapply_Click()
'for applying the effects
apply
End Sub

Private Sub cmdcancel_Click()
'for cancelling the update
txtolduser.Text = ""
txtoldpass.Text = ""
txtnewuser.Text = ""
txtnewpass.Text = ""
End Sub

Private Sub cmdexit_Click()
'closing the form
Unload frmsettings
End Sub

Private Sub cmdok_Click()
'for also applying but getting the real issue
Dim er

If Validate = True And displayn = True Then
          er = MsgBox("Apply The Changes", vbOKCancel + vbInformation, "Apply")
          If er = vbOK Then
          apply
          Else
          Unload frmgsettings
          End If
          
          
ElseIf Validate = False And displayn = True Then
          er = MsgBox("Apply The Changes", vbOKCancel + vbInformation, "Apply")
          apply
          If er = vbOK Then
          apply
          Else
          Unload frmgsettings
          End If
          
          
          
ElseIf Validate = True And displayn = False Then
          er = MsgBox("Apply The Changes", vbOKCancel + vbInformation, "Apply")
          If er = vbOK Then
          apply
          Else
          Unload frmgsettings
          End If


          End If
End Sub

Private Sub cmdvalidate_Click()
'to validate the user input
Validate = False
a = txtolduser.Text
a1 = txtoldpass.Text
b = txtnewuser.Text
b1 = txtnewpass.Text

If a <> "" And a1 <> "" Then
If b <> "" And b1 <> "" Then
If a = frmLogin.username And a1 = frmLogin.password Then

     If b <> "" And b1 <> "" Then
     'frmgsettings.Hide
     Load frmValidate
     frmValidate.Show
     End If
Else
MsgBox "Invalid Old User Name and Old Password"
txtolduser.SetFocus
 SendKeys "{Home}+{End}"
txtoldpass.Text = ""
End If
Else
MsgBox ("Must specify Values for New Username And New Password")
End If
Else
MsgBox ("Specify User Name and Password")
End If
End Sub


Private Sub Form_Activate()
txtolduser.SetFocus
End Sub
Private Sub apply()
'used to apply the changed effects on the settings
If Validate = False And displayn = False Then
Unload frmgsettings
ElseIf Validate = True And displayn = False Then
With frmLogin
.datsettings.Recordset.Edit
.datsettings.Recordset.Fields("UserName") = b
.datsettings.Recordset.Fields("Password") = b1
.datsettings.Recordset.Update
frmgsettings.Hide
Load frmsuccessiful
frmsuccessiful.timsuccess.Enabled = True
frmsuccessiful.Show
Unload frmgsettings

End With
ElseIf displayn = True And Validate = False Then
With frmLogin
'.datsettings.Recordset.Edit
'.datsettings.Recordset.Fields("mdi") = m(0)
.datsettings.Recordset.Fields("borrowing") = m(1)
.datsettings.Recordset.Fields("returning") = m(2)
.datsettings.Recordset.Fields("userdetails") = m(3)
.datsettings.Recordset.Fields("bookinfo") = m(4)
.datsettings.Recordset.Update
frmgsettings.Hide
Load frmsuccessiful
frmsuccessiful.timsuccess.Enabled = True
frmsuccessiful.Show
Unload frmgsettings

End With
ElseIf Validate = True And displayn = True Then
With frmLogin
.datsettings.Recordset.Edit
.datsettings.Recordset.Fields("UserName") = b
.datsettings.Recordset.Fields("Password") = b1
.datsettings.Recordset.Fields("mdi") = m(0)
.datsettings.Recordset.Fields("borrowing") = m(1)
.datsettings.Recordset.Fields("returning") = m(2)
.datsettings.Recordset.Fields("userdetails") = m(3)
.datsettings.Recordset.Fields("bookinfo") = m(4)
.datsettings.Recordset.Update
End With
frmgsettings.Hide
Load frmsuccessiful
frmsuccessiful.timsuccess.Enabled = True
frmsuccessiful.Show
Unload frmgsettings

Else
Unload frmgsettings
End If
End Sub

Private Sub Form_Load()
'these is aform that allows the user of the system to alter
'the login info and the different forms color
Dim Index As Integer
For Index = 0 To 4
With cbocolor(Index)
.AddItem "Blue"
.AddItem "Red"
.AddItem "Green"
.AddItem "Black"
.AddItem "White"
.AddItem "Yellow"
End With
Next Index

With frmLogin
'm(0) = .datsettings.Recordset.Fields("mdi")
'm(1) = .datsettings.Recordset.Fields("borrowing")
'm(2) = .datsettings.Recordset.Fields("returning")
'm(3) = .datsettings.Recordset.Fields("userdetails")
'm(4) = .datsettings.Recordset.Fields("bookinfo")
End With
For Index = 0 To 4
Debug.Print m(Index)
Next Index
End Sub
Private Sub getcolor()
'gets the selected color
If mycolor = "Blue" Then
returncolor = vbBlue
ElseIf mycolor = "Red" Then
returncolor = vbRed
ElseIf mycolor = "Green" Then
returncolor = vbGreen
ElseIf mycolor = "Black" Then
returncolor = vbBlack
ElseIf mycolor = "White" Then
returncolor = vbWhite
ElseIf mycolor = "Yellow" Then
returncolor = vbYellow
End If
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -