How can i disable the save botton of SaveFileDialog control

  • 13 years ago

  • 13 years ago

    The dialog boxes supplied by VS utilise Win32 API (COM) and can only be manipulated if you have knowledge of C++, or can find out the parameters for the COM component. I have'nt got a clue where this is hidden, but the syntax for working with COM objects is:

    Declare Auto Function MBox Lib "user32.dll" Alias "MessageBox" ( _
        ByVal hWnd As Integer, _
        ByVal txt As String, _
        ByVal caption As String, _
        ByVal Typ As Integer) _
        As Integer

    This is for the Microsoft MsgBox, but I imagine the Dialog boxes are hidden away in the user32.dll as well. Check out the Win32 documentation for further details, we are trying to move away from COM. If you can't be bothered with all this, just make your own dialog using a modal form, and use a list view (for example). The only tricky bit is manipulating the files, but is not such a big issue if you know what you're doing. Seems quite a big job just to get a disabled button, so you're choice.

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The question of whether computers can think is just like the question of whether submarines can swim.” - Edsger W. Dijkstra