📄 frmmain.frm
字号:
Email.Enabled = True
End If
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub Email_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Len(First_Name.Text) > 0 Then
If Auto_Send_Email = On_ Then
If Valid_Email_Address(Email.Text) = True Then
StatusBar1.Panels(1).Text = "Double Mouse-Click to AutoSend Email To " & First_Name.Text
Else
StatusBar1.Panels(1).Text = "Enter A Valid Email Address to AutoSend Email To " & First_Name.Text
End If
Else
StatusBar1.Panels(1).Text = "Right Mouse-Click to Enable AutoSend Email To " & First_Name.Text
End If
Else
If Auto_Send_Email = On_ Then
StatusBar1.Panels(1).Text = "Right Mouse-Click to Disable AutoSend Email"
Else
StatusBar1.Panels(1).Text = "Right Mouse-Click to Enable AutoSend Email"
End If
End If
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub First_Name_KeyPress(KeyAscii As Integer)
If (KeyAscii = 95) Or (KeyAscii = 39) Or (KeyAscii = 34) Then
MsgBox "Sorry, but the character ( " & Chr(KeyAscii) & " ) that is an invalid character", vbInformation + vbOKOnly
KeyAscii = 0
End If
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub Form_Load()
frmLogin.Hide
Set frmLogin = Nothing
Call Load_Links
Call Init_Main
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
PopupMenu mnuFile
End If
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(1).Text = "My Family Address Book v2.0 by SmileyOmar inc."
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim CloseDbase As Database
Dim CloseRecordset As Recordset
Dim loggedOut As Boolean
On Error GoTo UnloadErr
loggedOut = False
If (Currently_Editting = True) Or (Currently_Adding = True) Then
MsgBox Current_LoginName & ", please Save or Cancel the changes that you have made.", vbInformation + vbOKOnly
Cancel = True
Exit Sub
End If
If MsgBox(Current_LoginName & " are you sure that you want to quit ?", vbQuestion + vbYesNo + vbDefaultButton2, "Do you want to quit " & Current_LoginName & "?") = vbNo Then
Cancel = True
Else
'Close Main Database
MainData1.Recordset.Close
MainData1.Database.Close
Set CloseDbase = OpenDatabase(Database_Path & "\" & Database_Name, False, False, ";pwd=" & Database_Password)
Set CloseRecordset = CloseDbase.OpenRecordset("SELECT * FROM Users WHERE LoginName = '" & Apostrophe(EncryptText(Current_LoginName, Database_Password)) & "'")
CloseRecordset.Fields.Refresh
loggedOut = False
If CloseRecordset.RecordCount > 0 Then
CloseRecordset.Edit
CloseRecordset.Fields("LoggedIn") = False
CloseRecordset.Update
CloseRecordset.Close
CloseDbase.Close
MsgBox Current_LoginName & " logged out successfully.", vbInformation + vbOKOnly
loggedOut = True
WriteIniFile App.Path & "\Family2.ini", Current_LoginName, "Last-Logged-Out", Format(Now, "Long Date")
End If
If loggedOut = False Then
If Current_AccessLevel = "Administrator" Then
MsgBox Current_LoginName & " not logged out successfully.", vbCritical + vbOKOnly
Else
MsgBox Current_LoginName & " not logged out successfully. Contact an Administrator.", vbCritical + vbOKOnly
End If
End If
Current_LoginName = ""
Current_AccessLevel = ""
Set frmAbout = Nothing
Set frmEdit = Nothing
Set frmHelp = Nothing
Set frmLinks = Nothing
Set frmProfile = Nothing
Set frmSearch = Nothing
Set frmSplash = Nothing
Set frmLogin = Nothing
Set frmMain = Nothing
End
End If
Exit Sub
UnloadErr:
If Err.Number <> 0 Then
MsgBox "An error has been encountered while trying to unload frmMain. Error:" & Str$(Err.Number) & " " & Err.Description, vbCritical + vbOKOnly
Err.Clear
End If
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub Form_Resize()
'Minimized
If Me.WindowState = 1 Then
If Minimize_To_Tray Then
Set TrayArea1.Icon = Me.Icon
TrayArea1.ToolTip = " Double-Click To Restore " & frmMain.Caption & " "
TrayArea1.Visible = True
frmMain.Hide
End If
End If
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub Frame1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
PopupMenu mnuFile
End If
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(1).Text = "My Family Address Book v2.0 by SmileyOmar inc."
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub Frame2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
PopupMenu mnuFile
End If
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub Frame4_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbRightButton Then
PopupMenu mnuFile
End If
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub Last_Name_KeyPress(KeyAscii As Integer)
If (KeyAscii = 95) Or (KeyAscii = 39) Or (KeyAscii = 34) Then
MsgBox "Sorry, but the character ( " & Chr(KeyAscii) & " ) that is an invalid character", vbInformation + vbOKOnly
KeyAscii = 0
End If
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
'Used to update the textboxes and combo boxes
Private Sub UpdateFileds()
On Error Resume Next
First_Name.Text = MainData1.Recordset.Fields("FirstName") & ""
Last_Name.Text = MainData1.Recordset.Fields("LastName") & ""
If IsNull(MainData1.Recordset.Fields("Sex")) Then
Sex.ListIndex = 0
Else
Sex.Text = MainData1.Recordset.Fields("Sex")
End If
Telephone.Text = MainData1.Recordset.Fields("Telephone") & ""
Address.Text = MainData1.Recordset.Fields("Address") & ""
City_State.Text = MainData1.Recordset.Fields("City_State") & ""
ZipCode.Text = MainData1.Recordset.Fields("ZipCode") & ""
Email.Text = MainData1.Recordset.Fields("EmailAddress") & ""
If IsNull(MainData1.Recordset.Fields("Relation")) Then
Relation.ListIndex = 0
Else
Relation.Text = MainData1.Recordset.Fields("Relation")
End If
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub mnuAbout_Click()
Load frmAbout
frmAbout.Show
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub mnuAbout2_Click()
Load frmAbout
frmAbout.Show
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub mnuAutoSend_Click()
If mnuAutoSend.Checked = True Then
Set_Auto_Send_Email (Off_)
mnuAutoSend.Checked = False
Else
Set_Auto_Send_Email (On_)
mnuAutoSend.Checked = True
End If
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub mnuClose_Click()
Call btnClose_Click
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub mnuEnable_Click()
If Auto_Send_Email = On_ Then
mnuAutoSend.Checked = True
Else
mnuAutoSend.Checked = False
End If
If Minimize_To_Tray Then
mnuTray.Checked = True
Else
mnuTray.Checked = False
End If
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub mnuExit_Click()
Call mnuRestore_Click
Call btnClose_Click
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub mnuFile_Click()
If Auto_Send_Email = On_ Then
mnuAutoSend.Checked = True
Else
mnuAutoSend.Checked = False
End If
If Minimize_To_Tray Then
mnuTray.Checked = True
Else
mnuTray.Checked = False
End If
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub mnuHelp_Click()
Load frmHelp
frmHelp.Show
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
'**********************************************************************
Private Sub mnuHelp2_Click()
Load frmHelp
frmHelp.Show
End Sub
'**********************************************************************
'**********************************************************************
'**********************************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -