用记事本保存以下内容 名为 名字.frm
希望能追加一些分数·毕竟手动
运用到 转换小写 和一些简单的东西
2个list 3个按钮 2个文本框
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 2895
ClientLeft = 60
ClientTop = 450
ClientWidth = 4515
LinkTopic = "Form1"
ScaleHeight = 2895
ScaleWidth = 4515
StartUpPosition = 3 '窗口缺省
Begin VB.ListBox List1
Height = 1500
ItemData = "Form1.frx":0000
Left = 600
List = "Form1.frx":0002
TabIndex = 8
Top = 1200
Width = 2415
End
Begin VB.CommandButton Command3
Caption = "删除"
Height = 495
Left = 3120
TabIndex = 7
Top = 1680
Width = 855
End
Begin VB.CommandButton Command2
Caption = "读取"
Height = 495
Left = 3480
TabIndex = 6
Top = 720
Width = 855
End
Begin VB.ListBox List2
Height = 1500
ItemData = "Form1.frx":0004
Left = 600
List = "Form1.frx":0006
TabIndex = 5
Top = 3000
Width = 2415
End
Begin VB.CommandButton Command1
Caption = "存入"
Height = 495
Left = 3480
TabIndex = 4
Top = 120
Width = 855
End
Begin VB.TextBox Text2
Height = 270
Left = 720
TabIndex = 1
Text = "钱"
Top = 720
Width = 2535
End
Begin VB.TextBox Text1
Height = 270
Left = 720
TabIndex = 0
Text = "Money"
Top = 240
Width = 2535
End
Begin VB.Label Label2
Caption = "解释"
Height = 255
Left = 120
TabIndex = 3
Top = 720
Width = 495
End
Begin VB.Label Label1
Caption = "英文"
Height = 255
Left = 120
TabIndex = 2
Top = 240
Width = 495
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Shu As String
Private Sub Command1_Click()
Dim Nei As String
Nei = Text1.Text & "----" & Text2.Text
List1.AddItem Text1.Text & "----" & Text2.Text
List2.AddItem Text2.Text
Open "c:\1.txt" For Append As #1
Print #1, Nei
Close #1
End Sub
Private Sub Command2_Click()
Dim s, cc As String
Dim str() As String
Dim i As Integer
If Dir("c:\1.txt") = "" Then
MsgBox "请先存入"
Else
List1.Clear
List2.Clear
List3.Clear
Open "c:\1.txt" For Input As #1
Do Until EOF(1)
Line Input #1, s
str = Split(s, "----")
List2.AddItem LCase((str(0)))
List1.AddItem (str(1))
Loop
Close #1
End If
End Sub
Private Sub Command3_Click()
List2.RemoveItem (List1.ListIndex)
List1.RemoveItem (List1.ListIndex)
End Sub
Private Sub Form_Load()
End Sub
Private Sub List1_Dblclick()
Dim Nuu As String
Nuu = InputBox("请输入英文", "英文")
Nuu = LCase(Nuu)
List2.Selected(List1.ListIndex) = True
If Nuu = List2.Text Then
MsgBox "对了", 64, "(*^__^*)...嘻嘻"
Else
MsgBox "错了", 48, "郁闷"
End If
End Sub
温馨提示:答案为网友推荐,仅供参考