请教"不说也罢"等高手问题,清除历史记录后的问题
打开窗体,清除历史记录后,留有两条分界线,怎样在两条分界线中间表注"无历史记录",字样
已解决,谢谢"不说也罢"
[ 本帖最后由 看学 于 2010-11-25 16:08 编辑 ]
程序代码:Private Sub Command1_Click()
Dim i As Integer
For i = 1 To mnuFilelist.Count - 1
Unload mnuFilelist(i)
Next i
Load mnuFilelist(1)
mnuFilelist(1).Caption = "无历史记录"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Dim file As Long
Dim mystring As String
Dim s As String
Dim strfilename As String
strfilename = App.Path & "\cdxx.ini"
file = FreeFile()
On Error Resume Next
Open strfilename For Input As #file
Do While Not EOF(file)
Line Input #file, mystring
If mystring <> "" Then
max_index = max_index + 1
Load mnuFilelist(max_index)
mnuFilelist(max_index).Caption = mystring
mnuFilelist(max_index).Visible = True
End If
Loop
Close #file
If mnuFilelist.UBound = 0 Then
Load mnuFilelist(1)
mnuFilelist(1).Caption = "无历史记录"
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim FNum As Integer
Dim strfilename As String
Dim i As Integer
FNum = FreeFile
strfilename = App.Path & "\cdxx.ini"
If Dir(strfilename) <> "" Then Kill strfilename
Open strfilename For Output As #FNum
For i = 1 To mnuFilelist.Count - 1
If mnuFilelist(i).Caption <> "无历史记录" Then Print #FNum, mnuFilelist(i).Caption
Next
Close #FNum
DoEvents
End Sub
