Visual C# - GUI and controls - 1

Slides:



Advertisements
Similar presentations
An Introduction to Visual Basic Terms & Concepts.
Advertisements

Information System Design Lab 5&6. User Interface Design.
Chapter 1: An Introduction to Visual Basic 2012
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Group Boxes and Panels Arrange components on a GUI Buttons and etc. can be placed inside a group box or panel. All these buttons move together when the.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Introduction to Visual Basic Chulantha Kulasekere.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
Ch 11: Userforms CP212 Winter Topics Designing User Forms o Controls Setting Properties o Tab Order o Testing Writing Event Handlers o Userform_Initialize.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Chapter 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
Chapter 12: Using Controls. Examining the IDE’s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 2 Creating a User Interface.
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Dreamweaver MX. 2 Overview of Templates n Forms enable you to collect data from ______. n A form contains ________ such as text fields, radio buttons,
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
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.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Object-Oriented Application Development Using VB.NET 1 Chapter 10 VB.NET GUI Components Overview.
Controls Part 2. DateTimePicker Control Used for representing Date/Time information and take it as input from user. Date information is automatically.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Visual Basic A Quick Tutorial VB Review for ACS 367.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Using Forms and Form Elements In Visual Basic.NET.
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
COMPUTER PROGRAMMING I Apply Procedures to Develop List Box and Combo Box Objects.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter One An Introduction to Visual Basic 2008.
Chapter 2 – Introduction to Windows Operating System II Manipulating Windows GUI 1CMPF112 Computing Skills for Engineers.
Dive Into® Visual Basic 2010 Express
Chapter 3: I Need a Tour Guide (Introduction to Visual Basic 2012)
Visual Basic.NET Windows Programming
Microsoft Visual Basic 2005: Reloaded Second Edition
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Topics Graphical User Interfaces Using the tkinter Module
Chapter 1: An Introduction to Visual Basic 2015
Chapter Topics 15.1 Graphical User Interfaces
Chapter 8: Writing Graphical User Interfaces
Chapter 2 – Introduction to the Visual Studio .NET IDE
3.01 Apply Controls Associated With Visual Studio Form
1. Introduction to Visual Basic
3.01 Apply Controls Associated With Visual Studio Form
Chapter 1: An Introduction to Visual Basic 2015
Visual studio 2010 SENG 403, Tutorial 2 SENG Winter 2011.
Using Procedures and Exception Handling
Apply Procedures to Develop Menus, List Box and Combo Box Objects
An Introduction to Visual Basic
Standard Controls.
DB Implementation: MS Access Forms
Visual programming Chapter 3: GUI (Graphical User Interface) Part I
Chapter 2 Visual Basic Interface
Visual Basic.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Creating a Windows Forms User Interface
DB Implementation: MS Access Forms
CIS 16 Application Development Programming with Visual Basic
Chapter 15: GUI Applications & Event-Driven Programming
6. WinForms 2003 C# GUI - Basics.
– A principal I/O mechanism in Windows
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Chapter 4 Enhancing the Graphical User Interface
Presentation transcript:

Visual C# - GUI and controls - 1 GUI - Graphical User Interface How your user interfaces with your program You can make it really easy (or difficult) for the user! Lots of controls e.g. buttons, textboxes, labels, menus You place them on the form IDE groups similar controls together You write code for them

Visual C# - GUI and controls - 2 Common Controls – in Toolbox Button TextBox ListBox (selectable list) Label Checkbox Radio buttons Picture box Menu Others in groups All have properties and events Part of OOP Containers – hold controls, e.g. Panel

Visual C# - GUI and controls - 3 Button Control – properties and events Main properties: Appearance – Color [sic], Image, Text Behavior [sic] – Enabled, Visible Data – Tag Design – Name Layout – Location, Size Main events: Click! Double-click

Visual C# - GUI and controls - 4 TextBox Control Properties – Similar to button, but also text entry Text (single line) Lines (multiline) MultiLine is a property ReadOnly Others - Autocomplete Events Keyboard events TextChanged Focus – Enter, Leave

Visual C# - GUI and controls - 5 ListBox – List of selectable items Properties: Items (collection) ScrollBars (H & V) MultiColumn Can have checked boxes Events Click SelectedIndexChanged

Visual C# - GUI and controls - 6 TextBox and ListBox text properties Text – all the text in the text or list box. Lines[0] – first line of text or list box – read only AppendText(“new text”); – adds text to textbox Lines.Length – number of lines in textbox ListBox Text – all the text in the listbox. Items.Add(“new list item”); Items.Insert(lineNo, “inserted text”); Clear(); SelectedItem – gets selected Data always a string – need to convert for numbers. More later

Visual C# - GUI and controls - 7 Containers Contain other controls Panel GroupBox Tabbed control More later

Visual C# - GUI and controls - 8 Non-visual controls Timer Displayed in status bar Properties: Name, Enabled, Interval, Tag Event: Tick – code executes when timer ‘ticks’

Visual C# - GUI and controls - 9 Dialog Boxes Easy way to display text information. Not a control – display when program runs MessageBox.Show("Message");

Visual C# - GUI and controls - 10 Dialog boxes: Can add Caption, buttons and icon: MessageBox.Show( "This will format your disk!", "Format caption", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); Can add more lines with escape chars \n, \r Check response with DialogResult.OK Note same command does different things! Depends on no. of parameters - Feature of OOP

Visual C# - GUI and controls - 11 Input? – Have to create your own form and display it Create new form Project> Add Windows Form (default name – Form2) Design form: Display form on button click: Form2 dialogForm = new Form2( ); if (dialogForm.ShowDialog( ) == DialogResult.OK) { .. } ‘new’ instantiates (creates) a new object (our form)

Visual C# - GUI and controls - 12 Weekly tasks: Example and tasks Dating form Splash screen, Snap program Watch video: Creating a user interface

Visual C# - GUI and controls - 13 Summary GUI Controls Button, Textbox etc Properties and Events Non-visual controls Dialog boxes Forms