Some basic GUI components Button: allows the user to click it to perform an action. CheckBox: A GUI control that is either selected or not selected. ComboBox: A dropdown list of items from which the user can make a selection, by clicking an item in the list or by typing into the box, if permitted. Panel: A container in which components can be placed. | Chapter 2. Graphical User Interface Hoàng Hữu Việt IT Faculty, Vinh University A reference of MSDN Library for Visual Studio 2005 Contents Introduction Windows Forms Event-Handling Model Control Properties and Layout Some basic GUI components Mouse Event Handling Keyboard Event Handling Slide Introduction Graphical User Interface (GUI) Allow interaction with program visually Is an object, accessed via keyboard or mouse Some basic GUI components Label: Used to display text or images that cannot be edited by the user. TextBox: An area in which the user inputs data from the keyboard. The area also can display information. Slide Introduction Some basic GUI components Button: allows the user to click it to perform an action. CheckBox: A GUI control that is either selected or not selected. ComboBox: A drop-down list of items from which the user can make a selection, by clicking an item in the list or by typing into the box, if permitted. Panel: A container in which components can be | Chapter 2. Graphical User Interface Hoàng Hữu Việt IT Faculty, Vinh University A reference of MSDN Library for Visual Studio 2005 Contents Introduction Windows Forms Event-Handling Model Control Properties and Layout Some basic GUI components Mouse Event Handling Keyboard Event Handling Slide Introduction Graphical User Interface (GUI) Allow interaction with program visually Is an object, accessed via keyboard or mouse Some basic GUI components Label: Used to display text or images that cannot be edited by the user. TextBox: An area in which the user inputs data from the keyboard. The area also can display information. Slide Introduction Some basic GUI components Button: allows the user to click it to perform an action. CheckBox: A GUI control that is either selected or not selected. ComboBox: A drop-down list of items from which the user can make a selection, by clicking an item in the list or by typing into the box, if permitted. Panel: A container in which components can be placed. Slide Windows Forms WinForms Create GUIs for programs Element on the desktop Represented by: Dialog Window MDI window Slide Windows Forms Control Component with graphical part, such as button or label Are visible Event Generated by movement from mouse or keyboard Event handlers performs action Specifics written by programmer Slide Windows Forms Controls for Windows Forms Slide Windows Forms Common Properties AcceptButton: Which button will be clicked when Enter is pressed. AutoScroll: Whether scrollbars appear when needed (if data fills more than one screen). CancelButton: Button that is clicked when the Escape key is pressed. FormBorderStyle: Border of the form (., none, single, 3D, sizable). Slide Windows Forms Common Properties Font: Font of text displayed on the form, as well as the default font of controls added to the form. Text: Text in the form’s title bar. Common Methods Close: Closes form and releases all resources. A closed form cannot be .