Answer the question
In order to leave comments, you need to log in
WInForm C++\CLI VS2013 Read text from file and output it to textbox?
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
Stream^ myStream;
openFileDialog1->Filter = "Текстовые файлы (*.txt)|*.txt|Все файлы (*.*)|*.*";
if (openFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK)
{
label1->Text = openFileDialog1->FileName;
if ( (myStream = openFileDialog1->OpenFile()) != nullptr )
{
// Insert code to read the stream here.
myStream->Close();
textbox1->text=Convert::ToString(myStream);
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question