CST238 Week 3 Questions / Concerns? Recap Check-off Take Home Lab#2 New topics – PictureBox – FlowLayoutPanel – Menu – Context Menu – Status Bar – Toolstrip.

Slides:



Advertisements
Similar presentations
Information System Design Lab 5&6. User Interface Design.
Advertisements

 2007 Dr. Natheer Khasawneh. Chapter 13. Graphical User Interface Concepts: Part 1.
Chapter 1: An Introduction to Visual Basic 2012
© by Pearson Education, Inc. All Rights Reserved. continued …
Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved.
Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab2 Managing Controls.
Microsoft Visual Basic 2010: Reloaded Fourth Edition
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
5-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
IE 411/511: Visual Programming for Industrial Applications
Tutorial 1: An Introduction to Visual Basic.NET1 Tutorial 1 An Introduction to Visual Basic.NET.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures.
Chapter 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Typing Application Introducing Keyboard Events, Menus, Dialogs and the Dictionary.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
1 Working with Menus and Dialog Boxes. 2 Objectives You will be able to Create and edit menus for Windows Forms applications. Write code to handle menu.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 2 Creating a User Interface.
CST238 Week 4 Questions / Concerns? Announcements – Start thinking about project ideas – Test#1 next Monday, 4/28/14 Recap Check-off Take Home Lab#3 New.
V 1.1 Programming III. Creating additional windows Event handling: preview/routed events.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
Chapter 9 - VB.Net by Schneider1 Chapter 9 – Additional Controls and Objects 9.1 List Boxes, Combo Boxes, and the File-Opening Control The List Box Control.
Copyright © 2014 Pearson Education, Inc. Chapter 2 Creating Applications with Visual Basic.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
BIL528 – Bilgisayar Programlama II Introduction 1.
Visual Basic.NET BASICS Lesson 3 Events and Code.
Chapter Two Creating a First Project in Visual Basic.
BIM211 – Visual Programming Interacting with Users Graphics 1.
1 Chapter Nine Using GUI Objects and the Visual Studio IDE.
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.
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 Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
McGraw-Hill © 2010 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 2 User Interface Design.
Microsoft Visual Basic 2005 BASICS Lesson 3 Events and Code.
Creating Menus Menu Bar – behaves like standard Windows menus Can be used in place of or in addition to buttons to execute a procedure Menu items are controls.
Chapter 3 I Need a Tour Guide (Introduction to Visual Basic 2010) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Graphical User Interface Components Version 1.1. Obectives Students should understand how to use these basic Form components to create a Graphical User.
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.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
 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.
2-1 Chapter 2 Using VB.NET to Create a First Solution.
Programming with Microsoft Visual Basic 2012 Chapter 1: An Introduction to Visual Basic 2012.
Graphical User Interface Concepts - Part 1 Session 08 Mata kuliah: M0874 – Programming II Tahun: 2010.
GUI Programming Prepared by: Ahmad Ramin Rahimee Assistant Professor ICTI.
Chapter 1: An Introduction to Visual Basic .NET
PictureBox, MessageBox, Multiple Forms, Splash Screens and Timers
Microsoft Visual Basic 2005: Reloaded Second Edition
IS 350 Course Introduction
Chapter 2 – Introduction to the Visual Studio .NET IDE
Chapter 1: An Introduction to Visual Basic 2015
Visual studio 2010 SENG 403, Tutorial 2 SENG Winter 2011.
Using GUI Objects and the Visual Studio IDE
Variables and Arithmetic Operations
Creating Applications with Visual Basic
Picture Viewer.
Multi-form applications and dialogs
Creating a Windows Forms User Interface
Copyright © 2006 Thomas P. Skinner
6. WinForms 2003 C# GUI - Basics.
Visual C# - GUI and controls - 1
Lecture 5 Menu Strip Demo with Dialog Controls.
Presentation transcript:

CST238 Week 3 Questions / Concerns? Recap Check-off Take Home Lab#2 New topics – PictureBox – FlowLayoutPanel – Menu – Context Menu – Status Bar – Toolstrip – Bitmap – Dialogs (special dialogs – FileOpen, color) In-Class Exercise #3 Take Home Lab#3

Recap Controls – Buttons – Textbox – Label Events – Click (button) – Keyboard events (KeyDown, KeyPress, KeyUp) – Form level events (Load) Layout control – organize controls – TableLayoutControl

Take Home Lab 2 Calculator – Process keyboard events – Table layout control for keys – Manage states First operand (example: 135) Operator (+) Second operand (23)

State Diagram Start Textbox (0) Operand1(0) Operand2(0) Operator(“”) EnterNumber1 Textbox (+d) Operand1(0) Operand2(0) Operator(“”) Enter a Digit (0..9,.) Enter a Digit (0..9,.) Operator Textbox (num) Operand1(num) Operand2(0) Operator(“op”) Enter an operator Enter a Digit (0..9,.) EnterNumber2 Textbox (0+d) Operand1(num) Operand2(0) Operator(“op” ) Enter an operator Result Textbox (num2->result) Operand1(resul t) Operand2(0) Operator(“”) Enter = Enter an operator Enter = Operand2 = num Enter a digit, Textbox(0)

PictureBox Control Two ways to load a picture: – Load method – Image property Properties – SizeMode (Normal, StretchImage, etc.) – BorderStyle – Anchor/Dock

Simple Picture Loader/Viewer

Simple Picture Loader/Viewer with Menu

MenuStrip & Toolstrip Control Download images from Visual Studio Image Library – us/download/details.aspx?id= us/download/details.aspx?id=35825 Add a Toolstrip to the form

Status Bar & Context Menu Add a status bar at the bottom to show filename Add a context menu to stretch the image

Using Properties.Resources Add images to the Resources Faster loading time Increase the size of executable

Example 2

Use layout controls TableLayoutControl FlowLayoutControl

Allow one control to flow into another control. Useful when you need to have multiple controls.

Dialog Forms that: – Provide information to the user, or – Request information from the user Generally modal – Cannot switch forms until dialog is closed. Several dialogs included with Windows Forms – MessageBox, Color, OpenFile, SaveFile, Print, etc. You can create your own custom dialog

Working with Dialogs Simple Dialogs – Just a function call – MessageBox.Show() Common/Custom Dialog – Create instance of dialog – Set properites – Show dialog using ShowDialog method Returns a meber of the DialogResult enumeration – Take action based on dialog result

Working with Dialog OpenFieDialog openFile1 = new OpenFileDialog(); openFile1.Filter = “JPEG Files (*.jpg)|*.jpg|PNG Files (*.png)|*.png|BMP Files (*.bmp)|*.bmp|All files (*.*)|*.*”; if (openFile1.ShowDialog() == DialogResults.OK) { //Do something with OpenFile1.FileName //which is the filename selected by the user if (openFile1.ShowDialog() == DialogResult.OK) { pictureBox1.Load(openFile1.FileName); }

Working with Color Dialog ColorDialog colorDialog1 = new ColorDialog(); if (colorDialog1.ShowDialog() == DialogResult.OK) pictureBox1.BackColor = colorDialog1.Color; //selected color

Custom Dialog Create form as you would any other Set form properties to add dialog look, feel and behavior – Set FormBorderStyle to FixedDialog Disables resizing of dialog – Set ControlBox property to false Removes minimize, maximize and close buttons from title bar – Set AcceptButton and CancelButton properties AcceptButton - pressing Enter is the same as clicking the button CancelButton – pressing Escape is the same as clicking the button Set dialog return value on button clicks – In event handler, or – Using the DialogResult property of the button

Example 1

In-Class Lab#3 Modify the second picture viewer – Add menu for Show, Close, Clear Picture & Background color – Add Toolstrip for these actions. – Add multiple pictures to the resources – Create an array of images – Create an array of caption – Add a Status bar to show the caption of the picture – Add context-menu to flip through pictures

Take-Home Exercise #3 Flag Quiz – Find some flag images and add them to resources (at least 10 images) – Create an array of images – Create an array of country names – Create an array of correct answers – Keep track of their scores