Graphical User Interfaces Chapters 14-15 Dr. Abraham
Windows Forms • Dialog • MDI (window multiple document Interface) Window • Controls and components are placed on the form. • Toolbox allows you to choose controls and components • A forms a container that holds the controls and components
Event handling • Events drives the program to perform a task • Click • Change • Time • Event handler is what you write
Visual studio generated code • Can give great insight into what is going on • See what is in the Designer.cs • It will have all controls and components you placed there. • Delegates and Event-Handling Mechanism • Event handlers are connected to a control’s events through objects called delegates. • Delegate object holds a reference to a method with a signature that is specified by the delates type’s declaration.
Creating event handlers • Double click on a control and write code • Known as default event • You can use the properties window to create event handlers • Click on the events (looks like the lightning) in the properties window.
Mouse handling • Show program
Keyboard events • Show program
Menus • Covered in class with program assignment • Choosing colors, calendar,etc. • Combobox – already coverd • Tab control – already covered
Visual ineritance • Base form • Child form