📄 frmclass.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{E95A2510-F3D1-416D-823B-4F840FE98091}#3.0#0"; "Command.ocx"
Object = "{3A6644DE-3402-11D9-9DE7-C33FAA87690A}#1.0#0"; "WinXPCEngine.ocx"
Begin VB.Form frmClass
ClientHeight = 7965
ClientLeft = 60
ClientTop = 60
ClientWidth = 9825
ControlBox = 0 'False
LinkTopic = "Form1"
MDIChild = -1 'True
Picture = "frmClass.frx":0000
ScaleHeight = 7965
ScaleWidth = 9825
WindowState = 2 'Maximized
Begin WinXPC_Engine.WindowsXPC WindowsXPC1
Left = 3060
Top = 3690
_ExtentX = 6588
_ExtentY = 1085
ColorScheme = 2
Common_Dialog = 0 'False
End
Begin VB.TextBox txtRow
Alignment = 2 'Center
Height = 375
Left = 1680
TabIndex = 1
Top = 1320
Width = 1575
End
Begin VB.ComboBox cboClass
Height = 315
Left = 3360
Style = 2 'Dropdown List
TabIndex = 0
Top = 1320
Width = 1575
End
Begin MSFlexGridLib.MSFlexGrid mgridAll
Height = 3255
Left = 1560
TabIndex = 2
Top = 1920
Width = 7215
_ExtentX = 12726
_ExtentY = 5741
_Version = 393216
Rows = 3
Cols = 7
FixedRows = 0
FixedCols = 0
AllowUserResizing= 3
End
Begin CSCommand.Command cmdFind
Height = 375
Left = 2040
TabIndex = 3
Top = 5760
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmClass.frx":151DA4
Caption = "显示"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin CSCommand.Command cmdExit
Height = 375
Left = 7320
TabIndex = 4
Top = 5760
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmClass.frx":151DC0
Caption = "关闭"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin CSCommand.Command cmdModiy
Height = 375
Left = 3360
TabIndex = 5
Top = 5760
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmClass.frx":151DDC
Caption = "修改"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin CSCommand.Command cmdPrint
Height = 375
Left = 4680
TabIndex = 6
Top = 5760
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmClass.frx":151DF8
Caption = "打印"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin CSCommand.Command cmdRModiy
Height = 375
Left = 6000
TabIndex = 7
Top = 5760
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmClass.frx":151E14
Caption = "修改节数"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "课程表"
BeginProperty Font
Name = "MS Sans Serif"
Size = 24
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Left = 4800
TabIndex = 9
Top = 360
Width = 1395
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "节数"
Height = 195
Left = 1200
TabIndex = 8
Top = 1440
Width = 360
End
End
Attribute VB_Name = "frmClass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strSql As String
Dim RS As ADODB.Recordset
Dim intRow As Integer, IntCol As Integer
Private Sub cboClass_Change()
Me.mgridAll.TextMatrix(intRow, IntCol) = Me.cboClass.Text
End Sub
Private Sub cboClass_Click()
Me.mgridAll.TextMatrix(intRow, IntCol) = Me.cboClass.Text
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdFind_Click()
'全部显示
On Error Resume Next
Me.cboClass.Visible = False
strSql = "select * from 课程表"
writeMS strSql, Me.mgridAll
Me.mgridAll.Rows = Me.mgridAll.Rows - 1
Me.txtRow = Me.mgridAll.Rows - 1
End Sub
Private Sub cmdModiy_Click()
'修改
On Error Resume Next
Me.cboClass.Visible = False
strSql = "delete * from 课程表"
dbOperate strSql
For i = 1 To Me.mgridAll.Rows - 1
strSql = "insert into 课程表 values('"
strSql = strSql & Trim(Me.mgridAll.TextMatrix(i, 0))
For j = 1 To Me.mgridAll.Cols - 1
strSql = strSql & "','" & Trim(Me.mgridAll.TextMatrix(i, j))
Next j
strSql = strSql & "')"
dbOperate strSql
Next i
End Sub
Private Sub cmdPrint_Click()
'打印
Me.cboClass.Visible = False
writeMSFlexGrid Me.mgridAll, "课程表"
End Sub
Private Sub cmdRModiy_Click()
'修改节数
Me.cboClass.Visible = False
Me.mgridAll.Rows = Val(Trim(Me.txtRow.Text)) + 1
End Sub
Private Sub Form_Load()
'初始化
Call cmdFind_Click
strSql = "select distinct 课程名字 from 课程设置表"
Set RS = dbSelect(strSql)
While Not RS.EOF
Me.cboClass.AddItem RS.Fields(0)
RS.MoveNext
Wend
Me.WindowsXPC1.InitSubClassing
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.cboClass.Visible = False
End Sub
Private Sub mgridAll_Click()
Call mgridAll_RowColChange
End Sub
Private Sub mgridAll_RowColChange()
'选择改变
If Me.mgridAll.Row <> 0 Then
Me.cboClass.Visible = True
Me.cboClass.Left = Me.mgridAll.CellLeft + Me.mgridAll.Left
Me.cboClass.Top = Me.mgridAll.CellTop + Me.mgridAll.Top
intRow = Me.mgridAll.Row
IntCol = Me.mgridAll.Col
Else
Me.cboClass.Visible = False
End If
End Sub
Private Sub txtRow_Change()
If Not IsNumeric(Trim(txtRow.Text)) Then
MsgBox "请输入数字!", vbOKCancelvbok + vbExclamation, "提示"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -