不知道用什么函数
怎么用VB编写 保存跟另存为 菜单!请指教
多谢!!

解决方案 »

  1.   

    用公共对话框控件可以实现:CommonDialog 控件
      

  2.   

    Private Sub Form_Load()
      With CommonDialog1
        .FileName = ""
        .Flags = cdlOFNOverwritePrompt
        .CancelError = True
      End With
    End SubPrivate Sub mnuSave_Click()
      On Error Goto errexit
      With CommonDialog1
        If .FileName = "" Then
          .DialogTitle = "保存"
          .ShowSave
        End If
        If .FileName > "" then
          '在这里写保存代码
        End If
      End With
    errexit:
    End SubPrivate Sub mnuSaveAs_Click()
      On Error Goto errexit
      With CommonDialog1
        .DialogTitle = "另存为"
        .ShowSave
        If .FileName > "" then
          '在这里写保存代码
        End If
      End With
    errexit:
    End Sub