frmlead.frm
来自「一款非常适合中小学教学任务不是很繁重的管理程序」· FRM 代码 · 共 317 行
FRM
317 行
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 frmLead
ClientHeight = 8415
ClientLeft = 60
ClientTop = 60
ClientWidth = 10140
ControlBox = 0 'False
LinkTopic = "Form1"
MDIChild = -1 'True
Picture = "frmLead.frx":0000
ScaleHeight = 8415
ScaleWidth = 10140
WindowState = 2 'Maximized
Begin WinXPC_Engine.WindowsXPC WindowsXPC1
Left = 3195
Top = 3915
_ExtentX = 6588
_ExtentY = 1085
ColorScheme = 2
Common_Dialog = 0 'False
End
Begin VB.TextBox txtNum
Alignment = 2 'Center
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3000
TabIndex = 9
Top = 1320
Width = 1215
End
Begin VB.ComboBox cboType
Height = 315
Left = 480
TabIndex = 7
Text = "Combo1"
Top = 4080
Width = 1455
End
Begin VB.ComboBox cboStudent
Height = 315
Left = 480
Style = 2 'Dropdown List
TabIndex = 6
Top = 4560
Width = 1695
End
Begin CSCommand.Command cmdFind
Height = 375
Left = 2280
TabIndex = 1
Top = 7680
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmLead.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 = 2
Top = 7680
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmLead.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 = 3
Top = 7680
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmLead.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 = 4
Top = 7680
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmLead.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 MSFlexGridLib.MSFlexGrid mgridIDuty
Height = 5295
Left = 2280
TabIndex = 5
Top = 1920
Width = 6255
_ExtentX = 11033
_ExtentY = 9340
_Version = 393216
FixedRows = 0
FixedCols = 0
ForeColor = 8388608
BackColorFixed = 16512
ForeColorFixed = 8388736
ForeColorSel = 65535
BackColorBkg = 16777215
GridColorFixed = 4210752
WordWrap = -1 'True
End
Begin CSCommand.Command cmdRSet
Height = 375
Left = 6240
TabIndex = 10
Top = 7680
Width = 975
_ExtentX = 1720
_ExtentY = 661
IconAlign = 0
Icon = "frmLead.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 Label2
BackStyle = 0 'Transparent
Caption = "人数"
Height = 255
Left = 2280
TabIndex = 8
Top = 1440
Width = 495
End
Begin VB.Label Label1
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "班干部设置表"
BeginProperty Font
Name = "MS Sans Serif"
Size = 18
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 4320
TabIndex = 0
Top = 600
Width = 2250
End
End
Attribute VB_Name = "frmLead"
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
Private Sub cboStudent_Change()
Me.mgridIDuty.Text = Me.cboStudent.Text
End Sub
Private Sub cboStudent_Click()
Me.mgridIDuty.Text = Me.cboStudent.Text
End Sub
Private Sub cboType_Change()
Me.mgridIDuty.Text = Me.cboType.Text
End Sub
Private Sub cboType_Click()
Me.mgridIDuty.Text = Me.cboType.Text
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdFind_Click()
'查找显示
On Error Resume Next
Me.cboStudent.Visible = False
Me.cboType.Visible = False
strSql = "select 班干部表.类型名,班干部表.学号,学生基本情况表.姓名 from 班干部表,学生基本情况表 where 班干部表.学号=学生基本情况表.学号 "
writeMS strSql, Me.mgridIDuty
Me.mgridIDuty.Rows = Me.mgridIDuty.Rows - 1
Me.txtNum.Text = Me.mgridIDuty.Rows - 1
End Sub
Private Sub cmdModiy_Click()
'修改
On Error Resume Next
Dim i As Integer
strSql = "delete * from 班干部表 "
dbOperate strSql
For i = 1 To Me.mgridIDuty.Rows - 1
strSql = "insert into 班干部表 values('"
strSql = strSql & Trim(Me.mgridIDuty.TextMatrix(i, 0)) & "','"
strSql = strSql & Trim(Me.mgridIDuty.TextMatrix(i, 1)) & "')"
dbOperate strSql
Next i
End Sub
Private Sub cmdPrint_Click()
'打印
Me.cboStudent.Visible = False
Me.cboType.Visible = False
writeMSFlexGrid Me.mgridIDuty, "班干部表"
End Sub
Private Sub cmdRSet_Click()
Me.mgridIDuty.Rows = Val(Trim(Me.txtNum.Text)) + 1
End Sub
Private Sub Form_Load()
'数据初始化
On Error Resume Next
strSql = "select 学号 from 学生基本情况表"
Set RS = dbSelect(strSql)
While Not RS.EOF
Me.cboStudent.AddItem RS.Fields(0)
RS.MoveNext
Wend
strSql = "select 名字 from 班干部类型表"
Set RS = dbSelect(strSql)
While Not RS.EOF
Me.cboType.AddItem RS.Fields(0)
RS.MoveNext
Wend
Me.cboStudent.Visible = False
Me.cboType.Visible = False
Call cmdFind_Click
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
Me.cboType.Visible = False
End Sub
Private Sub mgridIDuty_Click()
Call mgridIDuty_RowColChange
End Sub
Private Sub mgridIDuty_RowColChange()
'选择的变化
On Error Resume Next
If Me.mgridIDuty.Row <> 0 And Me.mgridIDuty.Col = 1 Then
Me.cboStudent.Visible = True
Me.cboStudent.Left = Me.mgridIDuty.CellLeft + Me.mgridIDuty.Left
Me.cboStudent.Top = Me.mgridIDuty.CellTop + mgridIDuty.Top
Else
Me.cboStudent.Visible = False
End If
If Me.mgridIDuty.Row <> 0 And Me.mgridIDuty.Col = 0 Then
Me.cboType.Visible = True
Me.cboType.Left = Me.mgridIDuty.CellLeft + Me.mgridIDuty.Left
Me.cboType.Top = Me.mgridIDuty.CellTop + mgridIDuty.Top
Me.cboType.Text = Me.mgridIDuty.Text
Else
Me.cboType.Visible = False
End If
End Sub
Private Sub txtNum_Change()
If Not IsNumeric(Trim(txtNum.Text)) Then
MsgBox "请输入数字!", vbOKCancelvbok + vbExclamation, "提示"
End If
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?