Change default arrangement of Save and Cancel buttons in SaveFileDialog

后端 未结 3 741
梦如初夏
梦如初夏 2021-01-15 10:50

I m coding in c# and I want to change the default arrangement of \'Save\' and \'Cancel\' buttons in SaveFileDialog. The default arrangement is that the \'Save\' button is ab

相关标签:
3条回答
  • 2021-01-15 11:05

    Maybe this could solve your problem Extending the save file dialog class

    0 讨论(0)
  • 2021-01-15 11:28

    That rings a bell. When you have the code to change the text of the button then you have the handle of the button window. Which you can then use when you pinvoke GetWindowRect and MoveWindow to move the button somewhere else. Visit pinvoke.net for the declarations.

    Beware that the dialog changed in every Windows version. The next one might well break your program. Your customer is not going to be disappointed when you don't do this.

    0 讨论(0)
  • 2021-01-15 11:30

    Please don't do this.

    The user is used to where these buttons appear. If you try to change their layout then you will just make you app feel wrong.

    If you have to do this then should make sure you use the legacy file dialogs (which will make your dialogs look even more odd on Vista/7). Use the lpfnHook field in the OPENFILENAME struct to obtain hooks in to the dialog procedure. Respond to the CDN_INITDONE notification and move the buttons around with MoveWindow or SetWindowPos. You'll have to hunt for the button window handles.

    But really, please don't do this, you'll just make your app worse.

    0 讨论(0)
提交回复
热议问题