I want to create a file open dialog with wxwidgets that uses the "new" style of the Common Item Dialog under Win-Vista and newer. Is there any way to achive this? With the wxFileDlg() I get a dialog as shown on the right side but I'd like to get th left dialog... both dialogs
-
1show us what have you tried so far by posting some of your code – Memos Electron Sep 10 '19 at 17:30
-
Do you mean `wxFileDialog`? – Barmak Shemirani Sep 10 '19 at 17:42
-
@micha, I believe that the Vista-style file dialog is not implemented in wx. Show some code and hopefully we might direct you properly. – Igor Sep 10 '19 at 18:32
-
Try https://stackoverflow.com/questions/1025912/dialog-has-a-modern-look-on-time-design-but-old-look-on-run-time-using-visual?noredirect=1&lq=1 – Mark Ransom Sep 10 '19 at 18:49
2 Answers
The dialogs
sample included in wxWidgets shows the example of "new style" file dialog if you use e.g. "Dialogs|File operations|Save dialog" menu item (or just press Ctrl+S) and there is nothing special to do. If this doesn't work for you, check that you're
- Not using some ancient version of wxWidgets.
- Have correct manifest in your application.
- Not using any custom controls in your dialog, as those are only supported in old style version.

- 21,740
- 3
- 39
- 42
-
I just downloaded the newest wxWidgets 3.1.2 and compiled the dialogs example. You are right the save dialog is the new one, while open shows the old one, I guess it's a good start to see whats going on in my application. – miicha Sep 11 '19 at 16:46
I struggled with this today so thought I would post here for the next person who has the same issue. If I were to guess, your code was calling either dialog.Center()
or dialog.CenterOnParent()
. I've posted a lengthy explanation of why this happens here.
From all my time spent on this today, you have to choose whether you want have the old common control dialog and be able to center it, or use the new common item dialog and have it appear in your windows top-left corner.
The good news is that Visual Studio, Word, Excel, Firefox, Chrome, and many others all use the new dialog and they all open at the top-left of the application window.

- 485
- 3
- 10