frmstay.frm
来自「一款非常适合中小学教学任务不是很繁重的管理程序」· FRM 代码 · 共 285 行
FRM
285 行
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 frmStay
ClientHeight = 8310
ClientLeft = 60
ClientTop = 60
ClientWidth = 9570
ControlBox = 0 'False
LinkTopic = "Form1"
MDIChild = -1 'True
Picture = "frmStay.frx":0000
ScaleHeight = 8310
ScaleWidth = 9570
WindowState = 2 'Maximized
Begin WinXPC_Engine.WindowsXPC WindowsXPC1
Left = 2925
Top = 3825
_ExtentX = 6588
_ExtentY = 1085
ColorScheme = 2
Common_Dialog = 0 'False
End
Begin VB.ComboBox cboStudent
Height = 315
Left = 1200
Style = 2 'Dropdown List
TabIndex = 10
Top = 1440
Width = 1575
End
Begin VB.TextBox txtRow
Alignment = 2 'Center
Height = 375
Left = 1440
TabIndex = 8
Top = 1080
Width = 1575
End
Begin MSFlexGridLib.MSFlexGrid mgridAll
Height = 3375
Left = 1080
TabIndex = 2
Top = 1800
Width = 8175
_ExtentX = 14420
_ExtentY = 5953
_Version = 393216
Rows = 3
FixedRows = 0
FixedCols = 0
AllowUserResizing= 3
End
Begin CSCommand.Command cmdFind
Height = 375
Left = 2280
TabIndex = 3
Top = 5640
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmStay.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 = 7560
TabIndex = 4
Top = 5640
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmStay.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 = 3600
TabIndex = 5
Top = 5640
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmStay.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 = 4920
TabIndex = 6
Top = 5640
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmStay.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 = 6240
TabIndex = 7
Top = 5640
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmStay.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 Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "行数"
Height = 195
Left = 960
TabIndex = 9
Top = 1200
Width = 360
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "注意:最多15列"
Height = 195
Left = 3120
TabIndex = 1
Top = 1200
Width = 1260
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 = 5040
TabIndex = 0
Top = 600
Width = 1395
End
End
Attribute VB_Name = "frmStay"
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 cboStudent_Change()
Me.mgridAll.TextMatrix(intRow, IntCol) = Me.cboStudent.Text
End Sub
Private Sub cboStudent_Click() '加载数据
Me.mgridAll.TextMatrix(intRow, IntCol) = Me.cboStudent.Text
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdFind_Click()
'查找
Me.cboStudent.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.cboStudent.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.cboStudent.Visible = False
writeMSFlexGrid Me.mgridAll, "座次表"
End Sub
Private Sub cmdRModiy_Click()
Me.cboStudent.Visible = False
Me.mgridAll.Rows = Val(Trim(Me.txtRow.Text)) + 1
End Sub
Private Sub Form_Load()
'初始化
On Error Resume Next
Dim i As Integer
Call cmdFind_Click
strSql = "select 学号 from 学生基本情况表"
Set RS = dbSelect(strSql)
While Not RS.EOF
Me.cboStudent.AddItem RS.Fields(0)
RS.MoveNext
Wend
Set RS = Nothing
Me.WindowsXPC1.InitSubClassing
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.cboStudent.Visible = False
End Sub
Private Sub mgridAll_Click()
Call mgridAll_RowColChange
End Sub
Private Sub mgridAll_RowColChange()
If Me.mgridAll.Row <> 0 Then
Me.cboStudent.Visible = True
Me.cboStudent.Left = Me.mgridAll.CellLeft + Me.mgridAll.Left
Me.cboStudent.Top = Me.mgridAll.CellTop + Me.mgridAll.Top
intRow = Me.mgridAll.Row
IntCol = Me.mgridAll.Col
Else
Me.cboStudent.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 + =
减小字号Ctrl + -
显示快捷键?