ファイルダイアログ - peace098beat/windows_applicaciton GitHub Wiki

	private: System::Void button_fileOpen_click(System::Object^  sender, System::EventArgs^  e) {
		//
		// filepathオープン
		//
		if (this->saveFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK){
			String ^ s = this->saveFileDialog1->FileName;
			this->textBox_filepath->Text = s;
		}
	}
	private: System::Void button_saveText_Click(System::Object^  sender, System::EventArgs^  e) {
		//
		// 書き出しテキストの保存
		//
		// String ^ write_string = this->textBox_writeText->Text;

		String ^ filepath = this->saveFileDialog1->FileName;

		System::IO::StreamWriter ^ sw = gcnew System::IO::StreamWriter(filepath);

		for (size_t i = 0; i < this->textBox_writeText->Lines->Length; i++)
		{
			sw->WriteLine(this->textBox_writeText->Lines[i]);
		}

		sw->Close();

	}
⚠️ **GitHub.com Fallback** ⚠️