www.pudn.com > xj1.rar > Form6.frm, change:2008-05-30,size:8784b


VERSION 5.00 
Begin VB.Form Form6  
   Caption         =   "创建题库" 
   ClientHeight    =   5055 
   ClientLeft      =   2820 
   ClientTop       =   3675 
   ClientWidth     =   7410 
   LinkTopic       =   "Form1" 
   MaxButton       =   0   'False 
   ScaleHeight     =   5055 
   ScaleWidth      =   7410 
   StartUpPosition =   2  '屏幕中心 
   Begin VB.CommandButton Command3  
      Caption         =   "创建填空题" 
      Height          =   375 
      Left            =   5040 
      TabIndex        =   18 
      Top             =   4440 
      Width           =   1215 
   End 
   Begin VB.TextBox TextAnswer1  
      Height          =   375 
      Left            =   4320 
      TabIndex        =   16 
      Top             =   3120 
      Width           =   2535 
   End 
   Begin VB.TextBox TextQuestion1  
      Height          =   1815 
      Left            =   4320 
      MultiLine       =   -1  'True 
      ScrollBars      =   2  'Vertical 
      TabIndex        =   15 
      Top             =   720 
      Width           =   2535 
   End 
   Begin VB.CommandButton Command2  
      Caption         =   "返回" 
      Height          =   375 
      Left            =   3360 
      TabIndex        =   12 
      Top             =   4440 
      Width           =   855 
   End 
   Begin VB.CommandButton Command1  
      Caption         =   "创建选择题" 
      Height          =   375 
      Left            =   1080 
      TabIndex        =   13 
      Top             =   4440 
      Width           =   1215 
   End 
   Begin VB.TextBox TextAnswer  
      Height          =   375 
      Left            =   1080 
      TabIndex        =   11 
      Top             =   3720 
      Width           =   495 
   End 
   Begin VB.TextBox TextD  
      Height          =   375 
      Left            =   1080 
      TabIndex        =   10 
      Top             =   3120 
      Width           =   2055 
   End 
   Begin VB.TextBox TextC  
      Height          =   375 
      Left            =   1080 
      TabIndex        =   9 
      Top             =   2520 
      Width           =   2055 
   End 
   Begin VB.TextBox TextB  
      Height          =   375 
      Left            =   1080 
      TabIndex        =   8 
      Top             =   1920 
      Width           =   2055 
   End 
   Begin VB.TextBox TextA  
      Height          =   375 
      Left            =   1080 
      TabIndex        =   7 
      Top             =   1320 
      Width           =   2055 
   End 
   Begin VB.TextBox TextQuestion  
      Height          =   375 
      Left            =   1080 
      MultiLine       =   -1  'True 
      TabIndex        =   6 
      Top             =   720 
      Width           =   2055 
   End 
   Begin VB.Label Label8  
      AutoSize        =   -1  'True 
      Caption         =   "答案" 
      Height          =   180 
      Left            =   3840 
      TabIndex        =   17 
      Top             =   3120 
      Width           =   360 
   End 
   Begin VB.Label Label7  
      AutoSize        =   -1  'True 
      Caption         =   "填空题目" 
      Height          =   180 
      Left            =   3480 
      TabIndex        =   14 
      Top             =   720 
      Width           =   720 
   End 
   Begin VB.Label Label6  
      AutoSize        =   -1  'True 
      Caption         =   "答案" 
      Height          =   180 
      Left            =   480 
      TabIndex        =   5 
      Top             =   3720 
      Width           =   360 
   End 
   Begin VB.Label Label5  
      AutoSize        =   -1  'True 
      Caption         =   "选 项D:" 
      Height          =   180 
      Left            =   360 
      TabIndex        =   4 
      Top             =   3120 
      Width           =   630 
   End 
   Begin VB.Label Label4  
      AutoSize        =   -1  'True 
      Caption         =   "选 项C:" 
      Height          =   180 
      Left            =   360 
      TabIndex        =   3 
      Top             =   2520 
      Width           =   630 
   End 
   Begin VB.Label Label3  
      AutoSize        =   -1  'True 
      Caption         =   "选 项B:" 
      Height          =   180 
      Left            =   360 
      TabIndex        =   2 
      Top             =   1920 
      Width           =   630 
   End 
   Begin VB.Label Label2  
      AutoSize        =   -1  'True 
      Caption         =   "选 项A:" 
      Height          =   180 
      Left            =   360 
      TabIndex        =   1 
      Top             =   1320 
      Width           =   630 
   End 
   Begin VB.Label Label1  
      AutoSize        =   -1  'True 
      Caption         =   "选择题目" 
      Height          =   180 
      Left            =   360 
      TabIndex        =   0 
      Top             =   720 
      Width           =   720 
   End 
   Begin VB.Menu file  
      Caption         =   "文件(&F)" 
      Begin VB.Menu login  
         Caption         =   "登录" 
      End 
      Begin VB.Menu creat  
         Caption         =   "创建试题库" 
         Enabled         =   0   'False 
      End 
      Begin VB.Menu a  
         Caption         =   "-" 
      End 
      Begin VB.Menu exit  
         Caption         =   "退出" 
      End 
   End 
   Begin VB.Menu daima  
      Caption         =   "源代码(&D)" 
      Begin VB.Menu local  
         Caption         =   "当前窗口" 
      End 
      Begin VB.Menu all  
         Caption         =   "所有窗口" 
      End 
   End 
End 
Attribute VB_Name = "Form6" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Dim rec As Xuezhe 
Dim rec1 As tiaokong 
 
Private Sub all_Click() 
'查看所有代码 
Call duma 
End Sub 
 
Private Sub Command1_Click() 
'题库中加入选择题 
If Command1.Caption = "创建选择题" Then 
TextQuestion.Text = "" 
Command3.Caption = "创建填空题" 
Command1.Caption = "保存" 
TextQuestion1.Enabled = False 
TextAnswer1.Enabled = False 
TextQuestion.Enabled = True 
TextQuestion.SetFocus 
TextA.Enabled = True 
TextB.Enabled = True 
TextC.Enabled = True 
TextD.Enabled = True 
TextAnswer.Enabled = True 
ElseIf TextQuestion.Text = "" Or TextA.Text = "" Or TextB.Text = "" Or TextC.Text = "" Or TextD.Text = "" Or TextAnswer.Text = "" Then 
MsgBox "请填写完整的题目信息", vbOKOnly, "提示" 
ElseIf Len(TextQuestion.Text) > 40 Or Len(TextA.Text) > 20 Or Len(TextB.Text) > 20 Or Len(TextC.Text) > 20 Or Len(TextD.Text) > 20 Or Len(TextAnswer.Text) > 1 Then 
MsgBox "题目或答案太长,请减短!", vbOKOnly, "提示" 
Else 
rec.Question = TextQuestion.Text 
rec.a = TextA.Text 
rec.B = TextB.Text 
rec.C = TextC.Text 
rec.D = TextD.Text 
rec.Answer = TextAnswer.Text 
On Error GoTo err 
Open "data\shiti1.dat" For Random As #5 Len = Len(rec) 
Put #5, LOF(5) / Len(rec) + 1, rec 
Close #5 
MsgBox "保存成功", vbOKOnly, "提示" 
err: If err.Number = 70 Then MsgBox "无法保存,可能是磁盘被写保护或被写满!", vbInformation, "提示" 
TextQuestion.Text = "" 
TextA.Text = "A." 
TextB.Text = "B." 
TextC.Text = "C." 
TextD.Text = "D." 
TextAnswer.Text = "" 
TextQuestion.SetFocus 
End If 
 
End Sub 
 
Private Sub Command2_Click() 
Load Form1 
Form1.Show 
Unload Me 
End Sub 
 
Private Sub Command3_Click() 
'题库中加入填空题 
If Command3.Caption = "创建填空题" Then 
TextQuestion1.Text = "" 
Command1.Caption = "创建选择题" 
Command3.Caption = "保存" 
TextQuestion1.Enabled = True 
TextQuestion1.SetFocus 
TextAnswer1.Enabled = True 
TextQuestion.Enabled = False 
TextA.Enabled = False 
TextB.Enabled = False 
TextC.Enabled = False 
TextD.Enabled = False 
TextAnswer.Enabled = False 
ElseIf TextQuestion1.Text = "" Or TextAnswer1.Text = "" Then 
MsgBox "请填写完整的题目信息", vbOKOnly, "提示" 
ElseIf Len(TextQuestion1.Text) > 60 Or Len(TextAnswer1.Text) > 20 Then 
MsgBox "题目或答案太长,请减短!", vbOKOnly, "提示" 
Else 
rec1.Question1 = TextQuestion1.Text 
rec1.answer1 = TextAnswer1.Text 
On Error GoTo err 
Open "data\shiti2.dat" For Random As #6 Len = Len(rec1) 
Put #6, LOF(6) / Len(rec1) + 1, rec1 
Close #6 
MsgBox "保存成功", vbOKOnly, "提示" 
err: If err.Number = 70 Then MsgBox "无法保存,可能是磁盘被写保护或被写满!", vbInformation, "提示" 
TextQuestion1.Text = "" 
TextAnswer1.Text = "" 
TextQuestion1.SetFocus 
End If 
End Sub 
 
Private Sub exit_Click() 
'结束程序 
End 
End Sub 
 
Private Sub Form_Load() 
TextQuestion.Enabled = False 
TextA.Enabled = False 
TextB.Enabled = False 
TextC.Enabled = False 
TextD.Enabled = False 
TextAnswer.Enabled = False 
TextQuestion1.Enabled = False 
TextAnswer1.Enabled = False 
End Sub 
 
Private Sub local_Click() 
'显示当前源窗体代码 
Form7.Show 
Form7.Label2.Caption = "data\form6.dat" 
Call dudaima 
End Sub 
Private Sub login_Click() 
'返加登录框 
Form1.Show 
Unload Me 
End Sub