1 / 9

Β΄ Μέρος : ΠΡΟΧΩΡΗΜΕΝΕΣ ΛΕΙΤΟΥΡΓΙΕΣ ΤΟΥ GUI

Β΄ Μέρος : ΠΡΟΧΩΡΗΜΕΝΕΣ ΛΕΙΤΟΥΡΓΙΕΣ ΤΟΥ GUI. Παπανίκος Νικόλαος Α.Μ Φασουράκη Ασημίνα Α.Μ 711. Αρχική Φόρμα. Ύπαρξη βασικής φόρμας μέσω της οποίας εκτελούνται οι εφαρμογές που επιθυμεί ο χρήστης. Button OK : Δημιουργία Message Box

nhungate
Download Presentation

Β΄ Μέρος : ΠΡΟΧΩΡΗΜΕΝΕΣ ΛΕΙΤΟΥΡΓΙΕΣ ΤΟΥ GUI

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Β΄ Μέρος : ΠΡΟΧΩΡΗΜΕΝΕΣ ΛΕΙΤΟΥΡΓΙΕΣ ΤΟΥ GUI Παπανίκος Νικόλαος Α.Μ Φασουράκη Ασημίνα Α.Μ 711

  2. Αρχική Φόρμα • Ύπαρξη βασικής φόρμας μέσω της οποίας εκτελούνται οι εφαρμογές που επιθυμεί ο χρήστης. • Button OK : Δημιουργία Message Box • Button QUIT: Κλείσιμο της φόρμας με την εντολή Close().

  3. Message Box • MessageBoxButtons buttons = MessageBoxButtons::OKCancel; MessageBox::Show(this,"You clicked on the form!","Message Box",buttons, MessageBoxIcon::Question); • Ο χρήστης δεν μπορεί να επέμβει στο παράθυρο First Formεάν δεν επιλέξει κάποιο από τα buttons του Message Box.

  4. Προσθήκη νέας φόρμαςProject -> Add New Item

  5. Εμφάνιση νέας φόρμας • NewForm^ frm; frm=gcnewNewForm(); frm->Show(); • Δεν υπάρχουν περιορισμοί στις λειτουργίες που μπορούν να εκτελεστούν μέσω της νέας φόρμας.

  6. Άνοιγμα αρχείουusing namespace System::IO (1/3) • String^ fileName; FileStream^ fs; StreamReader^ sr; this->openFileDialog1->DefaultExt = "txt"; this->openFileDialog1->FileName = "txtDisplay.txt"; this->openFileDialog1->Filter="Text files (*.txt)|*.txt|All files (*.*|*.*)"; this->openFileDialog1->InitialDirectory=Application::ExecutablePath; if ( openFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK)

  7. Άνοιγμα αρχείου (2/3) try { fileName = openFileDialog1->FileName; fs = gcnew FileStream(fileName,FileMode::Open,FileAccess::ReadWrite); sr = gcnew StreamReader(fs); txtDisplay->Text = sr->ReadToEnd(); sr->Close(); } catch (System::Exception ^e){ MessageBox::Show("File Open Error: \n" + e->ToString(),"File Open Error",MessageBoxButtons::OK, MessageBoxIcon::Error); sr->Close();}

  8. Άνοιγμα αρχείου (2/3)

  9. ΤΕΛΟΣ ΔΙΑΦΑΝΕΙΩΝ

More Related