|
楼主 |
发表于 2024-3-16 09:24
|
显示全部楼层
登录界面的代码:
Private Sub CommandButton3_Click()
If TextBox1.Text = "" Then MsgBox ("请输入密码!"): Exit Sub
If TextBox1.Text = "888888" Then
Sheet19.Range("AB1") = Sheet19.Range("AA1")
MsgBox ("恭喜您,注册成功!")
CommandButton1.Enabled = True
'TextBox1.Text = ""
Else
MsgBox "密码不正确,系统退出!"
Application.Visible = True
Application.Quit
End If
End Sub
Private Sub UserForm_Initialize()
mywin = FindWindow(vbNullString, Me.Caption)
SYSTEMmenu = GetSystemMenu(mywin, 0)
Res = RemoveMenu(SYSTEMmenu, 5, MF_BYPOSITION)
Res = RemoveMenu(SYSTEMmenu, 5, MF_BYPOSITION)
TextBox2.Text = Sheet3.Range("A34").Value
If Sheet19.Range("AA1").Value <> Sheet19.Range("AB1").Value Then
CommandButton1.Enabled = False
End If
End Sub
Private Sub CommandButton1_Click()
a = TextBox1.Text
If "888888" = a Then
欢迎
Application.Visible = True
Sheet6.Select
Unload Me
Sheet6.Select
自定义
Else
MsgBox "密码错误,系统退出!"
Application.Visible = True
Application.Quit
End If
End Sub
Private Sub CommandButton2_Click()
Unload Me
Application.Quit
End Sub
自定义窗口和Excel表格模式
Sub 自定义()
OpenMenu '调用用户自定义菜单函数
On Error Resume Next
Application.CommandBars("Standard").Visible = False
Application.CommandBars("Formatting").Visible = False
Application.CommandBars("Visual Basic").Visible = False
Application.CommandBars("Web").Visible = False
Application.CommandBars("Protection").Visible = False
Application.CommandBars("Borders").Visible = False
Application.CommandBars("Forms").Visible = False
Application.CommandBars("Formula Auditing").Visible = False
Application.CommandBars("Drawing").Visible = False
Application.CommandBars("Watch Window").Visible = False
Application.CommandBars("Control Toolbox").Visible = False
Application.CommandBars("List").Visible = False
Application.CommandBars("Task Pane").Visible = False
Application.CommandBars("Reviewing").Visible = False
Application.CommandBars("PivotTable").Visible = False
Application.CommandBars("Stop Recording").Visible = False
Application.CommandBars("Chart").Visible = False
Application.CommandBars("Picture").Visible = False
Application.CommandBars("External Data").Visible = False
Application.CommandBars("Text To Speech").Visible = False
Application.CommandBars("WordArt").Visible = False
Application.CommandBars("符号栏").Visible = False
Application.MoveAfterReturn = False
Application.Caption = ""
Application.StatusBar = " 本软件由周建敏开发制作,远程帮助QQ:492917033 【版权所有 违者必究】 "
Application.DisplayFormulaBar = False
Application.ShowWindowsInTaskbar = False
ActiveWindow.DisplayWorkbookTabs = False
ActiveWindow.DisplayHorizontalScrollBar = False
End Sub
打开的时候导入WAV音乐
Sub 欢迎()
Call PlaySound(ThisWorkbook.Path & "\欢迎.WAV", 0&, SND_FILENAME Or SND_ASYNC)
End Sub
|
|