Hello,
im currently making a save function for my Project wich is like this :
private: System::Void Form1_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e)
{
String^Sleeptime = textBox4->Text;
StreamWriter^ sWriter = gcnew StreamWriter("c:\\DoNotEdit !.txt");
sWriter->WriteLine(Sleeptime);
sWriter->Flush();
sWriter->Close();
}
And this for the load function:
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e)
{
if ( File::Exists("c:\\DoNotEdit !.txt") )
{
StreamReader^ myFile = File::OpenText("c:\\DoNotEdit !.txt");
Form1::textBox4->Text = myFile->ReadLine();
myFile->Close();
}
else
{
StreamWriter^ sWriter = gcnew StreamWriter("c:\\DoNotEdit !.txt");
sWriter->WriteLine(100);
sWriter->Close();
}
But now im trying to save and load the color picked of a ColorDialog.
(The user can choose a Color and the background of the form becomes the picked color)
(http://msdn.microsoft.com/en-us/library/system.windows.forms.colordialog.aspx)
I tryed some stuff, but it all didn't worked.
So what should is use to get it working ?
Help is greatly appreciated !