C++/CLI C++/CLR ドットネット

.net FrameWorkで ディレクトリを選択するダイアログを作る方法

System::Windows::Forms::FolderBrowserDialog ^ dialog = gcnew ::System::Windows::Forms::FolderBrowserDialog();

dialog->Description = "出力するフォルダを選択して下さい";
//最初に選択するフォルダを指定する
dialog->SelectedPath = ::System::IO::Directory::GetCurrentDirectory();
//ユーザーが新しいフォルダを作成できるようにする
//デフォルトでTrue
dialog->ShowNewFolderButton = true;

if(dialog->ShowDialog( this) == ::System::Windows::Forms::DialogResult::OK) {
this->textbox_out->Text = dialog->SelectedPath;
}