OpenFileDialog va PrintDocument komponеntalari.
Dastur kodi quyida bеrilgan:
1.
#pragma endregion
2.
IO::StreamReader^ uqish;
3.
private: System::Void Form1_Load(System::Object^ sender,
4.
System::EventArgs^ e) {this->Text = "Matn faylni chop qilish";
5.
richTextBox1->Clear();
6.
//richTextBox1->ScrollBars = ScrollBars::Vertical;
7.
chopQilishToolStripMenuItem->Visible = false;
8.
openFileDialog1->FileName = nullptr;
9.
richTextBox1->Font =gcnew Drawing::Font("Times New Roman",
14.0F);}
10.
private: System::VoidochishToolStripMenuItem_Click(
System::Object^ sender, System::EventArgs^ e) {
11.
// Ochish menyusi buyrug'i tanlanganda:
116
Oybek Mallayev
12.
openFileDialog1->Filter = "Mant fayllar (*.txt)|*.txt|All
files
13.
(*.*)|*.*";
14.
openFileDialog1->ShowDialog();
15.
if(openFileDialog1->FileName == nullptr) return;
16.
try{
//Fayldan o'qish uchun StreamReader potokini hosil qilish
Do'stlaringiz bilan baham: |