1 Replies - 6195 Views - Last Post: 30 May 2013 - 10:02 AM

#1 Lov3Audio  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 24-April 13

How to save without bringing up the savedialog box

Posted 29 May 2013 - 01:15 AM

I'm trying to save without bringing up the save dialog box, i have tried a few different methods with no success.

i want to just save a file by pressing save, like in notepad..this is the code i have so far but it return

FileStream ^ f;
private: System::Void saveToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
			 StreamWriter ^ w=gcnew StreamWriter(f);
			 w->WriteLine(this->textBox1->Text);
			 w->WriteLine(this->textBox2->Text);
			 w->Close();
		 }



any help would be greatly appreciated!

Is This A Good Question/Topic? 0
  • +

Replies To: How to save without bringing up the savedialog box

#2 Lov3Audio  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 17
  • Joined: 24-April 13

Re: How to save without bringing up the savedialog box

Posted 30 May 2013 - 10:02 AM

Figured this out in case anyone else was wondering.

private: System::Void saveToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {

			 StreamWriter ^ w=gcnew StreamWriter(openFileDialog1->FileName);
			 w->WriteLine(this->textBox1->Text);
			 w->WriteLine(this->textBox2->Text);
                         w->close();


This post has been edited by Lov3Audio: 30 May 2013 - 10:11 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1