@@ -235,6 +235,47 @@ private void LoadSettings()
235235 }
236236 }
237237
238+ // .NET Core implements the better Vista-style folder browse dialog in the stock FolderBrowserDialog
239+ #if NETCOREAPP
240+ private void btnBrowse1_Click ( object sender , EventArgs e )
241+ {
242+ FolderBrowserDialog dialog = new FolderBrowserDialog
243+ {
244+ RootFolder = Environment . SpecialFolder . MyComputer ,
245+ Description = "Select a folder where 86Box program files and the roms folder are located" ,
246+ UseDescriptionForTitle = true
247+ } ;
248+
249+ if ( dialog . ShowDialog ( ) == DialogResult . OK )
250+ {
251+ txtEXEdir . Text = dialog . SelectedPath ;
252+ if ( ! txtEXEdir . Text . EndsWith ( @"\" ) ) //Just in case
253+ {
254+ txtEXEdir . Text += @"\" ;
255+ }
256+ }
257+ }
258+
259+ private void btnBrowse2_Click ( object sender , EventArgs e )
260+ {
261+ FolderBrowserDialog dialog = new FolderBrowserDialog
262+ {
263+ RootFolder = Environment . SpecialFolder . MyComputer ,
264+ Description = "Select a folder where your virtual machines (configs, nvr folders, etc.) will be located" ,
265+ UseDescriptionForTitle = true
266+ } ;
267+
268+ if ( dialog . ShowDialog ( ) == DialogResult . OK )
269+ {
270+ txtCFGdir . Text = dialog . SelectedPath ;
271+ if ( ! txtCFGdir . Text . EndsWith ( @"\" ) ) //Just in case
272+ {
273+ txtCFGdir . Text += @"\" ;
274+ }
275+ }
276+ }
277+ // A custom class is required for Vista-style folder dialogs under the original .NET Framework
278+ #else
238279 private void btnBrowse1_Click ( object sender , EventArgs e )
239280 {
240281 FolderSelectDialog dialog = new FolderSelectDialog
@@ -270,6 +311,7 @@ private void btnBrowse2_Click(object sender, EventArgs e)
270311 }
271312 }
272313 }
314+ #endif
273315
274316 private void btnDefaults_Click ( object sender , EventArgs e )
275317 {
0 commit comments