📄 form1.frm
字号:
Top = 0
Width = 1575
End
End
Begin VB.PictureBox XPFrame1
Height = 930
Left = 1875
ScaleHeight = 870
ScaleWidth = 10140
TabIndex = 0
Top = 8240
Width = 10200
Begin VB.PictureBox XPButton4
Height = 375
Left = 6000
MousePointer = 99 'Custom
ScaleHeight = 315
ScaleWidth = 1035
TabIndex = 1
ToolTipText = "只可修改鼠标所在行"
Top = 150
Width = 1095
End
Begin VB.PictureBox XPButton5
Height = 375
Left = 4680
MousePointer = 99 'Custom
ScaleHeight = 315
ScaleWidth = 1035
TabIndex = 2
ToolTipText = "确认从添加开始"
Top = 150
Width = 1095
End
Begin VB.PictureBox XPButton6
Height = 375
Left = 7320
MousePointer = 99 'Custom
ScaleHeight = 315
ScaleWidth = 1035
TabIndex = 4
ToolTipText = "删除鼠标当前所在行"
Top = 150
Width = 1095
End
Begin VB.PictureBox XPButton8
Height = 375
Index = 0
Left = 8640
MousePointer = 99 'Custom
ScaleHeight = 315
ScaleWidth = 1035
TabIndex = 17
ToolTipText = "输入当前光标处学生成绩"
Top = 150
Width = 1095
End
End
Begin VB.PictureBox Grid1
Appearance = 0 'Flat
Height = 6000
Left = 1875
ScaleHeight = 5970
ScaleWidth = 10110
TabIndex = 5
Top = 2235
Width = 10140
End
Begin VB.PictureBox Grid2
Appearance = 0 'Flat
Height = 6000
Left = 1875
ScaleHeight = 5970
ScaleWidth = 10110
TabIndex = 18
Top = 2235
Width = 10140
End
Begin VB.PictureBox XPButton1
Height = 375
Left = 9360
MousePointer = 99 'Custom
ScaleHeight = 315
ScaleWidth = 1035
TabIndex = 19
Top = 1800
Width = 1095
End
Begin VB.PictureBox XPButton2
Height = 375
Left = 10680
MousePointer = 99 'Custom
ScaleHeight = 315
ScaleWidth = 1035
TabIndex = 20
Top = 1800
Width = 1095
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "共0页 第0页"
ForeColor = &H00000000&
Height = 255
Left = 7440
TabIndex = 21
Top = 1880
Width = 1575
End
Begin VB.Image Image3
Height = 6630
Index = 1
Left = 1730
Picture = "Form1.frx":2D9AF
Top = 2240
Width = 150
End
Begin VB.Image Image2
Height = 255
Index = 1
Left = 150
Picture = "Form1.frx":33B85
Top = 8640
Width = 1575
End
Begin VB.Image Image2
Height = 255
Index = 0
Left = 150
Picture = "Form1.frx":37939
Top = 2240
Width = 1575
End
Begin VB.Image Image3
Height = 6630
Index = 0
Left = 0
Picture = "Form1.frx":3B6ED
Top = 2240
Width = 150
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 615
Left = 240
TabIndex = 3
Top = 1560
Width = 7095
End
End
Attribute VB_Name = "form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i, j, n As Integer
Dim sql As String
Private Declare Function GetKeyState Lib "user32" _
(ByVal nVirtKey As Long) As Integer
Public je As Integer '记忆菜单上次数值,实现数据传送
Private Sub acg_Click()
Call asPopup7_Click(False)
End Sub
Private Sub addcg_Click()
Call asPopup6_Click(False)
End Sub
Private Sub addstudent_Click()
Call asPopup2_Click(False)
End Sub
Private Sub asPopup1_Click(Cancel As Boolean)
Grid1.Visible = True
Grid2.Visible = False
tkbase = "学生信息"
fnumber = 13
sql = "select * from " & tkbase
grid1pz '执行grid1的分配空间任务
datagrid '按要求读取数据空间
End Sub
Private Sub grid1pz()
Grid1.Cols = fnumber + 1
Grid1.Column(1).Width = 120
Grid1.Column(2).Width = 100
Grid1.Column(3).Width = 80
Grid1.Column(4).Width = 40
Grid1.Column(5).Width = 80
Grid1.Column(6).Width = 30
Grid1.Column(7).Width = 100
Grid1.Column(8).Width = 200
Grid1.Column(9).Width = 60
Grid1.Column(10).Width = 80
Grid1.Column(11).Width = 100
Grid1.Column(12).Width = 100
Grid1.Column(13).Width = 100
Grid1.Column(4).CellType = cellComboBox
Grid1.ComboBox(4).Clear
Grid1.ComboBox(4).AddItem "男"
Grid1.ComboBox(4).AddItem "女"
Grid1.Column(5).CellType = cellCalendar
Grid1.Column(1).Locked = True
End Sub
Private Sub asPopup2_Click(Cancel As Boolean)
Grid1.Visible = True
Grid2.Visible = False
tkbase = "学生信息"
fnumber = 13
Set qy1 = cnn.Execute("select * from " & tkbase)
grid1pz
For i = 1 To fnumber
Grid1.Cell(0, i).Text = qy1.Fields(i - 1).Name
Next
Grid1.Column(1).Locked = False
Grid1.Rows = 1
Grid1.Rows = 21
gridsave = True '允许保存
griddelete = False '拒绝删除
gridedit = False
End Sub
Private Sub asPopup3_Click(Cancel As Boolean)
Dim fo2 As CTranslucentForm
Set fo2 = New CTranslucentForm
fo2.hWnd = Form2.hWnd
fo2.Alpha = 90 / 100 * 255
Me.WindowState = vbMinimized
Load Form2
Form2.Show 1
End Sub
Private Sub asPopup4_Click(Cancel As Boolean)
Dim fo2 As CTranslucentForm
Set fo2 = New CTranslucentForm
fo2.hWnd = Form4.hWnd
fo2.Alpha = 90 / 100 * 255
Me.WindowState = vbMinimized
Load Form4
Form4.Show 1
End Sub
Private Sub asPopup5_Click(Cancel As Boolean)
MsgBox "非完整源码不可查询!"
End Sub
Private Sub asPopup6_Click(Cancel As Boolean)
Grid1.Visible = False
Grid2.Visible = True
tkbase = "学生与课程"
fnumber = 5
gridpz2
Set qy1 = cnn.Execute("select * from " & tkbase)
For i = 1 To fnumber
Grid2.Cell(0, i).Text = qy1.Fields(i - 1).Name
Next
Grid2.Rows = 1
Grid2.Rows = 21
gridsave = True
gridedit = False
griddel = False
Grid2.Column(1).Locked = False
Grid2.Column(2).Locked = False
Grid2.Column(3).Locked = False
End Sub
Private Sub asPopup7_Click(Cancel As Boolean)
Grid1.Visible = False
Grid2.Visible = True
tkbase = "学生与课程"
fnumber = 5
sql = "select * from " & tkbase
gridpz2
datagrid
gridsave = False
gridedit = True
griddel = True
Grid2.Column(1).Locked = True
Grid2.Column(2).Locked = True
Grid2.Column(3).Locked = True
End Sub
Private Sub gridpz2()
Grid2.Cols = 7
Grid2.Column(1).CellType = cellComboBox
Set qy1 = cnn.Execute("select 课程号 from 课程")
Grid2.ComboBox(1).Clear
Do While Not qy1.EOF
Grid2.ComboBox(1).AddItem qy1.Fields(0)
qy1.MoveNext
Loop
Grid2.Column(2).CellType = cellComboBox
Set qy1 = cnn.Execute("select 课程名称 from 课程")
Grid2.ComboBox(2).Clear
Do While Not qy1.EOF
Grid2.ComboBox(2).AddItem qy1.Fields(0)
qy1.MoveNext
Loop
End Sub
Private Sub asPopup9_Click(Cancel As Boolean)
End
End Sub
Private Sub c1_Click(Index As Integer) '提交内容到函数执行,4为当前菜单(0-4),index是按钮数组名称
cmove 4, Index
End Sub
Private Sub cmove(s As Integer, i As Integer) '菜单智能移动函数代码
Dim j As Integer
Dim x, y, z, x1, y1 As Integer
x = s
y = s
z = s
x1 = s
j = 0
Do While s > 0
If je > i Then
Do While x > i
Do While y >= x
j = j + 360
y = y - 1
Loop
c1(x).Top = Fre1.Height - j
x = x - 1
Loop
Else
'-----------------向上代码
For x = 0 To i
For y = 0 To x
j = j + 360
Next
c1(x).Top = j - 360
j = 0
Next
End If
s = s - 1
For y1 = 0 To x1
If y1 = i Then
Fre2(y1).Visible = True
Fre2(y1).Top = c1(y1).Top + c1(y1).Height
If y1 <> z Then
Fre2(y1).Height = c1(y1 + 1).Top - Fre2(y1).Top
Else
Fre2(y1).Height = Fre1.Height - c1(y1).Top - c1(y1).Height
End If
Else
Fre2(y1).Visible = False
End If
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -