vb.net 如何从另存为对话框中删除取消按钮?

How to remove the Cancel button from a save as dialog in vb.net?

我想从另存为对话框中删除取消按钮!但是在网上翻了很多题目,还是没有令人信服的结果!有可能吗?

我正在 vb.net.

开发应用程序
Dim saveFileDialog1 As SaveFileDialog = New SaveFileDialog()
        saveFileDialog1.Filter = "Word Document (*.docx)|*.docx|Word 97-2003 Document (*.doc)|*.doc|Plain Text (*.txt)|*.txt"
        saveFileDialog1.FilterIndex = 1
        saveFileDialog1.RestoreDirectory = True
        saveFileDialog1.OverwritePrompt = True
        saveFileDialog1.FileName = System.IO.Path.GetFileName(files)

        If saveFileDialog1.ShowDialog() = DialogResult.OK Then

            auxFile = IO.Path.GetFileNameWithoutExtension(files) & ".docx"
            My.Computer.FileSystem.RenameFile(files, auxFile)

        ElseIf DialogResult.Cancel Then

            saveFileDialog1.FileName = ""

        End If
Using sfd As New SaveFileDialog
    'Configure sfd here.

    Do Until sfd.ShowDialog() = DialogResult.OK
    Loop

    'Use sfd.FileName here.
End Using

如果您愿意,可以在循环内显示一条消息,告诉用户他们必须 select 一个文件路径。如果您还没有明确表示 select 文件路径是强制性的,这将防止他们认为您的应用程序已损坏。