Graphical User Interface (GUI) A GUI allows user to interact with a program visually. GUIs are built from GUI components. A GUI component is an object.

Slides:



Advertisements
Similar presentations
Chapter 3.1 Controls Programming In Visual Basic.NET.
Advertisements

© by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
Chapter 2 –Visual Basic, Controls, and Events
C# Programming: From Problem Analysis to Program Design1 9 Programming Based on Events.
C# Programming: From Problem Analysis to Program Design1 Programming Based on Events C# Programming: From Problem Analysis to Program Design 3 rd Edition.
Chapter 31 Visual Basic Controls A Form is a windows-style screen displayed by Visual Basic programs. In a form, a programmer can create objects in a form.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Chapter 4: Working with Windows Types of Windows –Program Windows –Message Boxes –Dialog Boxes Elements of a Window –Window Panes –Scroll Bars –Menus –Tool.
Chapter 2 –Visual Basic, Controls, and Events
Chapter 3 Introduction to Event Handling and Windows Forms Applications.
Microsoft Visual Basic 2012 CHAPTER TWO Program and Graphical User Interface Design.
IE 411/511: Visual Programming for Industrial Applications
Week 2: WINDOWS PROGRAMMING Chapter 15 in “Beginning Visual C# 2010” ebook Chapter 4 in “”MCTS_Self-Paced_Training_Kit” ebook.
Chapter 12: Using Controls. Examining the IDE’s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton.
Chapter 2 More Controls Programming in C#. NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Assignment #1 Advanced Computer Programming.
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 2 Creating a User Interface.
G RAPHICAL U SER I NTERFACE C ONCEPTS : P ART 1 1 Outline Introduction Windows Forms Event-Handling Model - Basic Event Handling.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 13 – Graphical User Interfaces Part 2 Outline.
Graphical User Interface Concepts - Part 2 Session 09 Mata kuliah: M0874 – Programming II Tahun: 2010.
COS240 O-O Languages AUBG, COS dept Lecture 33 Title: C# vs. Java (GUI Programming) Reference: COS240 Syllabus.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 12 - Graphical User Interface Concepts: Part.
Visual C# 2012 How to Program 1. 2  A graphical user interface (GUI) allows a user to interact visually with a program.  Figure 14.1 shows a Visual.
Graphical User Interfaces 2 Tonga Institute of Higher Education.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
C# GUI - Basics. Objectives.NET supports two types: WinForms, traditional, desktop GUI apps. WebForms – newer, for Web apps. Visual Studio.NET supports.
Controls. Adding Controls to Form -You can pick controls from the toolbox. -To add the controls from Toolbox to the Form You have be in design view. -To.
Chapter 2 – Introduction to the Visual Studio .NET IDE
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
More Controls and Their Properties Part 4 dbg --- TextBox, CheckBox, RadioButton, GroupBox, ToolTips,
SEEM3460 Tutorial GUI in Java. Some Basic GUI Terms Component (Control in some languages) the basic GUI unit something visible something that user can.
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
Chapter 2 More Controls Programming in C#. NET Objectives Use text boxes, group boxes, check boxes, radio buttons, and picture boxes effectively.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Chapter 2 Creating Applications with Visual Basic.
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
 2009 Pearson Education, Inc. All rights reserved. 1 CS1120 Introduction to Windows Forms Applications Many slides modified by Prof. L. Lilien (even many.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Dr. Abraham Professor UTPA Graphical User Interface.
 You won’t write a single line of program code.  Instead, you’ll use visual programming techniques.  Visual Studio processes your actions (such as mouse.
Graphical User Interface Concepts - Part 1 Session 08 Mata kuliah: M0874 – Programming II Tahun: 2010.
Dive Into® Visual Basic 2010 Express
Microsoft Visual Basic 2005: Reloaded Second Edition
IS 350 Course Introduction
Chapter 2 – Introduction to the Visual Studio .NET IDE
3.01 Apply Controls Associated With Visual Studio Form
Graphical User Interface Concepts: Part I
Program and Graphical User Interface Design
3.01 Apply Controls Associated With Visual Studio Form
Standard Controls.
Windows Desktop Applications
Chap 7. Building Java Graphical User Interfaces
Graphical User Interfaces -- Introduction
Program and Graphical User Interface Design
Variables and Arithmetic Operations
Chapter 2 – Introduction to the Visual Studio .NET IDE
Windows Controls Child Window Controls
6. WinForms 2003 C# GUI - Basics.
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Presentation transcript:

Graphical User Interface (GUI) A GUI allows user to interact with a program visually. GUIs are built from GUI components. A GUI component is an object with which the user interacts via the mouse and keyboard.

Some basic components Label - An area in which icons or text can be displayed TextBox – An area in which user inputs data Button – An area that triggers an event when clicked 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 ListBox – An area in which a list of items is displayed Panel – A container in which components can be placed HScrollBar – A horizontal scroll bar. VScrollBar – A vertical scroll bar.

Window form A form is a graphical element that appears on the desktop. A form can be a dialog, an SDI window (single document interface window) or an MDI window (multiple document interface window)

Form property and events Common properties  AcceptButton – specifies which button will be clicked when user press enter  AutoScroll – specifies whether scrollbars appear when needed  CancelButton – specifies which button is clicked when user presses Esc  FormBorderStyle – specifies the border of the form  Font -specifies the font of text displayed in the form as well as the default font of controls added to the form  Text – specifies the text in the form’s title bar

Form properties and events Common methods  Close – closes form.  Hide – hides form  Show – display a hidden form Common events  Load – occurs before a form is shown

Basic event handling Double-click the click event in the property window to create an empty event handler in the program code private: System::void formName_Click(System::Object *sender, System::EventArgs *e) { MessageBox::Show(S”Form was pressed”); };

Register event-handler with delegate After creating the event-handler, we must register it with the delegate, which contains a list of event handlers to call. Controls have a delegate for each of their events The delegate has the same name as the event If we are handling event EventName for object myControl, then the delegate pointer is myControl->EventName.NET registers events for us this->Click += new System::EventHandler(this, Form1_Click); The first argument to the EventHandler constructor is a pointer to the object that contains the method specified as the second argument. Form1_click is a method of class Form1. The first argument will be 0 if the method is static method

Control properties BackColor: background color of the control Text: text associated with the control TextAlign: The alignment of the text on the control. Font:Font used to display control’s text ForeColor: Foreground color of the control. Usually color of the text Focused: specifies whether the control has focus Visible: specifies whether the control is visible

Common methods Focus: Transfer the focus to the control Hide: Hides the control( equivalent to setting Visible to false) Show: shows the control(equivalent to setting Visible to true)

Control layout Anchor: anchoring allows control to stay a fixed distance from the sides of the container, even when the control is resized Dock: docking allows control to extend themselves along the sides of their containers Fill dock option effectively docks the control to all sides of its parent Dockpadding sets the distance from docked controls to the edge of the form.

Create window form project From File->new -> project Select window form application(.Net) Click view->toolbox if toolbox is not open Drag and drop the controls to design GUI