90 likes | 110 Views
CECS 5020 Computers in Education. Forms and Menus. Types of Forms. Single Document Interface One document at a time Multiple Document Interface More than one document at a time “Child” forms on the MDI form are constrained to stay inside the MDI form. Experiment with SDI and MDI Forms.
E N D
CECS 5020Computers in Education Forms and Menus
Types of Forms • Single Document Interface • One document at a time • Multiple Document Interface • More than one document at a time • “Child” forms on the MDI form are constrained to stay inside the MDI form
Experiment with SDI and MDI Forms • Create two forms, Form1 and Form2, both of which have their “MDI Child” properties set to False • Add a line to Form1’s Load event to show Form2 (“Form2.Show”)
Creating a MDI Form • Add a new MDI form (Project/Add MDI Form) • Set the MDI Child property of Form 2 to “True” • Run the program and see how Form 2 behaves when you resize it and move it outside of the MDI form’s boundaries • Note how Form 1 behaves also
Form Properties • Caption • Icon • Height, Width, Left, Top • Background Color • MouseIcon, MousePointer (99 for custom) • StartUp Position • WindowState
Form Events • Resize • Use this event to re-size child controls or forms • Click • MouseMove • Load • Unload
Code a Form Event • Create a new project with an MDI Form and a child form • Code the MDI Form’s Resize event to resize the child form to 1/2 the size of the MDIForm Private Sub MDIForm_Resize() Form1.Width = MDIForm1.Width / 2 Form1.Height = MDIForm1.Height / 2 End Sub
Menus • Menu Editor • Creates hierarchical menus • Captions that are only - (hyphen) create separator bars • Shortcut keys are created by putting an ampersand before the letter that is the shortcut • &File • E&xit
Creating a Menu for Your Project • Tools/Menu Editor • &File • &New • &Open • E&xit • &Edit • &Help