⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmtjadd.frm

📁 VB编写的中小学监考老师排表软件
💻 FRM
📖 第 1 页 / 共 4 页
字号:
         Caption         =   "3"
         ForeColor       =   &H00000000&
         Height          =   255
         Index           =   2
         Left            =   0
         TabIndex        =   80
         Top             =   870
         Visible         =   0   'False
         Width           =   300
      End
      Begin VB.Label Label2 
         Alignment       =   2  'Center
         BackColor       =   &H0080FF80&
         Caption         =   "2"
         ForeColor       =   &H00000000&
         Height          =   255
         Index           =   1
         Left            =   0
         TabIndex        =   79
         Top             =   450
         Visible         =   0   'False
         Width           =   300
      End
      Begin VB.Label Label2 
         Alignment       =   2  'Center
         BackColor       =   &H0080FF80&
         Caption         =   "1"
         ForeColor       =   &H00000000&
         Height          =   255
         Index           =   0
         Left            =   60
         TabIndex        =   78
         Top             =   270
         Visible         =   0   'False
         Width           =   300
      End
   End
   Begin VB.TextBox textjname 
      Height          =   315
      Left            =   1080
      TabIndex        =   5
      Top             =   0
      Width           =   2715
   End
   Begin VB.ListBox listtjbj 
      Height          =   3480
      Left            =   1710
      MultiSelect     =   2  'Extended
      TabIndex        =   1
      Top             =   1050
      Width           =   1095
   End
   Begin VB.ListBox listtjkc 
      Height          =   3480
      Left            =   60
      TabIndex        =   0
      Top             =   1050
      Width           =   765
   End
   Begin VB.Label Label1 
      Caption         =   "条件名称:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   60
      TabIndex        =   6
      Top             =   30
      Width           =   975
   End
   Begin VB.Label Label11 
      Caption         =   "第一要素:课程名"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   465
      Left            =   60
      TabIndex        =   4
      Top             =   450
      Width           =   1005
   End
   Begin VB.Label Label12 
      Caption         =   "第二要素:班级范围"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   465
      Left            =   1710
      TabIndex        =   3
      Top             =   450
      Width           =   1065
   End
   Begin VB.Label Label13 
      Caption         =   "第三要素:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3450
      TabIndex        =   2
      Top             =   420
      Width           =   1365
   End
End
Attribute VB_Name = "frmtjadd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Dim bjexp() As bjtype
'Dim x0(34), y0(34) As Integer
Dim kcexp() As kctype
Dim jhao, bjs As Integer

Private Sub Cmdadd_Click()
If listtjkc.ListIndex = -1 Then MsgBox "无指定课程!": Exit Sub
If listtjbj.SelCount = 0 Then MsgBox "无指定班级范围!": Exit Sub
If textjname = "" Then MsgBox "无条件名称!": Exit Sub
If Len(textjname) > 10 Then MsgBox "条件名称不能超过10个字!": Exit Sub

Text2.Text = "|"
For i = 0 To listtjbj.ListCount - 1
If listtjbj.Selected(i) = True Then
Text1.Text = listtjbj.List(i)
Text2.Text = Text2.Text + Text1.Text + "|"
End If
Next i

Dim tjs As Integer
Open App.Path + "\tjshu.bin" For Binary As #6
Get #6, 1, tjs
Dim newtj As tjtype
Dim onetj As tjtype
Open App.Path + "\tj.ran" For Random As #5 Len = Len(newtj)
newtj.tjkcm = listtjkc.List(listtjkc.ListIndex)
newtj.tjbjm = Text2.Text

For i = 1 To tjs
Get #5, i, onetj
Text1.Text = onetj.tjkcm
Text3.Text = onetj.tjbjm

If Left$(listtjkc.List(listtjkc.ListIndex), 2) = Left$(Text1.Text, 2) And Trim$(Text2.Text) = Trim$(Text3.Text) Then MsgBox "已有同名条件!": GoTo exsub

Next i

For i = 0 To Class - 1
For j = 0 To Day - 1
textj(Day * i + j).ForeColor = &H0&
tjzhicheck = Trim(textj(Day * i + j).Text) Like "#" Or Trim(textj(Day * i + j).Text) Like "##" Or textj(Day * i + j).Text = "-1"

If tjzhicheck = False Then MsgBox "有不合理的条件值!": textj(Day * i + j).ForeColor = &HFF&: GoTo exsub
Next j
Next i

For i = 0 To Class - 1
For j = 0 To Day - 1
newtj.tjzhi(i, j) = Val(textj(Day * i + j).Text)
newtj.tjzhich(i, j) = 0
Next j
Next i
newtj.tjname = Trim(textjname.Text)

Put #5, tjs + 1, newtj
tjs = tjs + 1
Put #6, 1, tjs

listtjkc.ListIndex = -1
For i = 0 To listtjbj.ListCount - 1
listtjbj.Selected(i) = False
Next i
For i = 0 To Class - 1
For j = 0 To Day - 1
textj(Day * i + j).Text = ""
Next j
Next i
textjname.Text = ""
'listtj.ListIndex = listtj.ListCount - 1
exsub:
Close #5
Close #6

End Sub

Private Sub cmdcancel_Click()
Dim tjs As Integer

Open App.Path + "\tjshu.bin" For Binary As #4
Get #4, 1, tjs
Close #4
Dim tjexp() As tjtype
ReDim tjexp(tjs)
Open App.Path + "\tj.ran" For Random As #3 Len = Len(tjexp(0))
For i = 1 To tjs
Get #3, i, tjexp(i)
Next i
Close #3

For i = 0 To tjs - 1
Text1.Text = tjexp(i + 1).tjname ': Text2.Text = tjexp(i + 1).tjbjm
frmtj.cmbtj.List(i) = Text1.Text '+ Text2.Text
Next i
Unload Me
End Sub

Private Sub Command3_Click()
For i = 0 To Class - 1
For j = 0 To Day - 1
textj(Day * i + j).Text = tjcopy35(i, j)
Next j
Next i

End Sub

Private Sub Form_Load()
Open App.Path + "\kc.ran" For Random As #8 Len = 18
Open App.Path + "\zkcshu.bin" For Binary As #1
Get #1, 1, zkcs
Close #1
ReDim kcminghao(zkcs)
ReDim kcexp(zkcs)
k = 0                            'set js-minghao()
For i = 1 To zkcs            'array ,it's total
Get #8, i, kcexp(i)                 'number is jss%=k
For j = 1 To i - 1               'start from No:1
If kcexp(i).kckcm = kcminghao(j) Then
 GoTo l1
End If
Next j
k = k + 1
kcminghao(k) = kcexp(i).kckcm
l1:
Next i
kcmengs = k
Close #8
For i = 1 To kcmengs
listtjkc.List(i - 1) = kcminghao(i)
Next i

'-----------------------fill listtjbj
Open App.Path + "\bjshu.bin" For Binary As #7
Get #7, 1, bjs
Close #7
'-----------------


ReDim bjexp(bjs) As bjtype           'write b-j to combo1.list
Open App.Path + "\bj.ran" For Random As #6 Len = 18
For i = 1 To bjs
Get #6, i, bjexp(i)
Text1.Text = Trim$(bjexp(i).bjnjm) & "  ": Text2.Text = Trim$(bjexp(i).bjbjm)
listtjbj.List(i - 1) = Text1.Text + Text2.Text
Next i
Close #6

'--------------fill listtj
Dim newtj As tjtype
Dim tjs As Integer


'555555
'begin controls
Dim frame1T0, frame1L0, stepT, stepL As Integer
frame1T0 = Frame1.Height - (Class + 2) * textj(0).Height ' 1600
frame1L0 = Frame1.Width - (Day + 3) * textj(0).Width
stepT = 50
stepL = 50
For i = 0 To Class * Day - 1
textj(i).Visible = True
textj(i).Top = Int(i / Day) * (stepT + textj(0).Height) + frame1T0
textj(i).Left = (i Mod Day) * (stepL + textj(0).Width) + frame1L0
Next i
'xingqi label
For i = 0 To Day - 1
label7(i).Visible = True
label7(i).Height = textj(0).Height
label7(i).Width = textj(0).Width
label7(i).Top = textj(0).Top - stepL - textj(0).Height
label7(i).Left = i * (stepL + textj(0).Width) + frame1L0
Next i
'first label
Label3.Height = textj(0).Height
Label3.Width = textj(0).Width
Label3.Top = frame1T0 - stepT - textj(0).Height
Label3.Left = frame1L0 - stepL - textj(0).Width
'jie label
For i = 0 To Class - 1
Label2(i).Visible = True
Label2(i).Height = textj(0).Height
Label2(i).Width = textj(0).Width
Label2(i).Left = textj(0).Left - stepL - textj(0).Width
Label2(i).Top = i * (stepL + textj(0).Height) + frame1T0
Next i
End Sub


Private Sub Label2_Click(Index As Integer)
'If textj(Index * Day + 1) = "0" Then
For i = 0 To Day - 1
textj(Index * Day + i).Text = "0"
Next i
End Sub


Private Sub Label2_DblClick(Index As Integer)
For i = 0 To Day - 1
textj(Index * Day + i).Text = "-1"
Next i

End Sub


Private Sub Label3_Click()
For i = 0 To Day * Class - 1
textj(i).Text = "0"
Next i

End Sub

Private Sub Label3_DblClick()
For i = 0 To Day * Class - 1
textj(i).Text = "-1"
Next i

End Sub


Private Sub label7_Click(Index As Integer)
For i = 0 To Class - 1
textj(i * Day + Index).Text = "0"
Next i

End Sub


Private Sub label7_DblClick(Index As Integer)
For i = 0 To Class - 1
textj(i * Day + Index).Text = "-1"
Next i

End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -