开发工具:
文件大小: 5kb
下载次数: 0
上传时间: 2009-12-08
详细说明: 一个可以显示历史的菜单 Option Explicit Dim main As New main_frm Public max_index As Integer Public myindex As Integer Private Sub close_Click() On Error Resume Next '循环语句 For Each main In Forms If main.MDIChild = True Then Unload main End If Next 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 mnufil elist.Count - 1 Print #FNum, mnufilelist(i).Caption Next Close #FNum Exit Sub End Sub Private Sub MDIForm_Load() 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 '关闭文件菜单列表 End Sub Private Sub MDIForm_Unload(Cancel As Integer) close_Click End Sub Private Sub mnufilelist_Click(Index As Integer) If mnufilelist(Index).Caption <> "" Then Static i As Integer If i < 1 Then i = 1 main_frm.Visible = False Dim main As New main_frm main.Caption = mnufilelist(Index).Caption i = i + 1 main.Picture = LoadPicture(mnufilelist(Index).Caption) main.Show End If End Sub Private Sub open_Click() '打开带图形的窗体 CommonDialog1.Filter = "所有图形文件" & "|*.jpg; *.bmp ; *.ico ;*.gif;*.cur" CommonDialog1.ShowOpen Static i As Integer If i < 1 Then i = 1 main_frm.Visible = False Dim main As New main_frm main.Caption = CommonDialog1.FileName i = i + 1 main.Picture = LoadPicture(CommonDialog1.FileName) main.Show max_index = mnufilelist.Count Load mnufilelist(max_index) mnufilelist(max_index).Caption = CommonDialog1.FileName mnufilelist(max_index).Visible = True End Sub Private Sub exit_Click() close_Click End End Sub ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.