DelphiFAQ Home Search:

How can I display a file selection box with C++ in .NET?

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

You need to instantiate an object of the SaveFileDialog class. Prepare the file selection filter and then display the modal dialog with the ShowDialog() call.

The selected filename can be retrieved as the FileName member. You can also preset this member.

Alternatively you could drop such a component on your application's form and set the properties there.

Personally, I prefer to create this kind of object dynamically and get rid of it right away.

SaveFileDialog* saveFileDialog1 = new SaveFileDialog();
 
saveFileDialog1->Filter = S"PEPCost files (*.pc)|*.pc|All files (*.*)|*.*"  ;
saveFileDialog1->FilterIndex = 1;
saveFileDialog1->RestoreDirectory = true;
 
if(saveFileDialog1->ShowDialog() == DialogResult::OK) {

// debugging message box
	System::Windows::Forms::MessageBox::Show("Your PEPCost file will be saved.",
		saveFileDialog1->FileName,
		MessageBoxButtons::OK,
		MessageBoxIcon::Information);
}

saveFileDialog1->Dispose();

Comments:

2014-12-16, 19:55:45
anonymous from Taipei, Taiwan  
Sorry for the late reply, I'm not sure how I missed it. FPL does soppurt exporting to Excel, however only CPL reports soppurt the Excel templating properties. Based on the feedback we had from DDR users, the majority of users didn't want to change the excel output. It just didn't make sense to invest the large amount of resources it would have taken to soppurt FPL reports.That said, many of the issues that plagued AR6 users with its Excel export with extra rows and columns being added have been resolved with design time changes that make it easier to perfectly align controls.
2014-12-26, 15:35:16
anonymous from Tekirdag, Turkey  
kalau benar dapat terawang kpnaea sim bahnya gag jadi konglomerat dan ente-ente yang promosiin kpnaea masih promosi gak jadi orang kaya .....ente ngibullllllllll alias wadulllllll ana pernar kena 4 anka 20jt, tapi bukan dapat nomor dari mbah ini dan mbah itu dapat dari hitungan and pas sama impian, tapi ana percaya itu rejeki dari tuhan yang maha esa,karna hanya dialah yang maha tau, bukan simbah ini.itu yang pasang nope BOHONG SEMUA''''''''''''''''''
2014-12-26, 15:35:16
anonymous from Tekirdag, Turkey  
kalau benar dapat terawang kpnaea sim bahnya gag jadi konglomerat dan ente-ente yang promosiin kpnaea masih promosi gak jadi orang kaya .....ente ngibullllllllll alias wadulllllll ana pernar kena 4 anka 20jt, tapi bukan dapat nomor dari mbah ini dan mbah itu dapat dari hitungan and pas sama impian, tapi ana percaya itu rejeki dari tuhan yang maha esa,karna hanya dialah yang maha tau, bukan simbah ini.itu yang pasang nope BOHONG SEMUA''''''''''''''''''
2014-12-26, 15:35:29
anonymous from Tekirdag, Turkey  
kalau benar dapat terawang kpnaea sim bahnya gag jadi konglomerat dan ente-ente yang promosiin kpnaea masih promosi gak jadi orang kaya .....ente ngibullllllllll alias wadulllllll ana pernar kena 4 anka 20jt, tapi bukan dapat nomor dari mbah ini dan mbah itu dapat dari hitungan and pas sama impian, tapi ana percaya itu rejeki dari tuhan yang maha esa,karna hanya dialah yang maha tau, bukan simbah ini.itu yang pasang nope BOHONG SEMUA''''''''''''''''''

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: