Picture Viewer.

Slides:



Advertisements
Similar presentations
A window application ---to know Dialogs (Week 7) ~csdywang/ta.htm.
Advertisements

Microsoft Expression Web-Illustrated Unit J: Creating Forms.
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
CST238 Week 3 Questions / Concerns? Recap Check-off Take Home Lab#2 New topics – PictureBox – FlowLayoutPanel – Menu – Context Menu – Status Bar – Toolstrip.
Copyright © 2012 Pearson Education, Inc. Chapter 11 MORE WINDOWS CONTROLS & STANDARD DIALOG BOXES.
C# Programming: From Problem Analysis to Program Design1 Programming Based on Events C# Programming: From Problem Analysis to Program Design 3 rd Edition.
Copyright © 2012 Pearson Education, Inc. Chapter 2 Introduction to Visual C#
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Visual Basic.net IDE. Integrated Development Environment.
1b – Inside Visual Studio Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
BIL528 – Bilgisayar Programlama II Introduction 1.
1 Graphical User Interfaces Part 2 Outline Multiple Document Interface (MDI) Windows Visual Inheritance User-Defined Controls.
Hello World In C++ and Microsoft Visual C++. Directions to begin a project 1. Go to All Programs 2. Open Visual Studio C++ 3. Click on New Project 4.
ADO.NET By Hanumantha Rao.N MCA By Hanumantha Rao.N MCA.
Analysing Data with Excel Importing Data from a Text File To import data from a text file: 1.Start Excel. 2.Click File, click New, click Workbook,
IE 411/511: Visual Programming for Industrial Applications
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.
A First Look At Microsoft Visual Basic Lesson 1. What is Microsoft Visual Basic? Microsoft Visual Basic is a software development tool, which means it.
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.
 2009 Pearson Education, Inc. All rights reserved Dive Into ® Visual C# 2008 Express.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Project Deployment IT [211 CAP] How to convert your project to a full application.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
BIL528 – Bilgisayar Programlama II Introduction 1.
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
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.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
As we upgrade from ImageNow 6.1 to ImageNow 6.3, there are some changes to the interface that the end-users will see. These slides cover changes to the.
By: Susan Freeman Getting Started 1.Go to Start Programs Microsoft PowerPoint.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
BBT 10 Visual Basic 03 Enrichment. Tip Before creating any files for your project, first create a new folder Save all of your files in the folder Pieces.
Chapter 3 I Need a Tour Guide (Introduction to Visual Basic 2010) Clearly Visual Basic: Programming with Visual Basic nd Edition.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
To Change the background color of the slide, choose Format / Background, which will bring up the following dialog box: Choose Fill Effects. This will bring.
1 Windows Forms II Chapter RadioButton / GroupBox Controls Used to solicit a multiple choice input. Radio buttons work as a group. Selecting one.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
1 Sophiebook 101: Exploring the interface. 2 Open a new book in Sophie 1.File > New Book 2.Click OK.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
 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.
Windows form programming. namespace MyNamespace { public class MyForm : System.Windows.Forms.Form { public MyForm() { this.Text = "Hello Form"; }
Module 3: Creating Windows-based Applications. Overview Creating the Main Menu Creating and Using Common Dialog Boxes Creating and Using Custom Dialog.
Chapter 3: I Need a Tour Guide (Introduction to Visual Basic 2012)
Chapter 1: An Introduction to Visual Basic .NET
Visual Studio 2010 Hello World CSC 230.
Computing with C# and the .NET Framework
Chapter 2 – Introduction to the Visual Studio .NET IDE
3.01 Apply Controls Associated With Visual Studio Form
3.01 Apply Controls Associated With Visual Studio Form
Visual studio 2010 SENG 403, Tutorial 2 SENG Winter 2011.
Visual Studio 2010 Hello World CSC 230.
How to Add Images Using an 'openFile' Dialog
Chapter 2 – Introduction to the Visual Studio .NET IDE
MDI Picture Viewer Application
المحاضرة الأولى Lab(1) أ.ساره الأحمدي برمجة حاسب 2.
Course Name Course Number Section Term – Instructor Name
Access Tutorial 8 Sharing, Integrating, and Analyzing Data
Module 8: Creating Windows-based Applications
Course Name Course Number Section Term – Instructor Name
Introduction to Visual Basic 2010
Tutorial 8 Sharing, Integrating, and Analyzing Data
Poker2.jpg Poker14.jpg int num1, num2;
Presentation transcript:

Picture Viewer

Create a new project Test an program Add basic controls like check boxes and buttons Position controls on a form using layouts Add Open File and Color dialog boxes Write code

Create a Windows Forms Application

Interface Main window Solution Explorer Properties window เป็นหน้าจอออกแบบ Form เขียน code Solution Explorer แสดงสิ่งต่างๆ ที่อยู่ใน solution เช่นไฟล์ต่างๆ Properties window เราสามารถเปลี่ยน properties ของสิ่งของที่เลือก

Run Your Program File-> Save All F5 Stop Program choose Start Debugging Stop Program Stop Debugging Choose X button in the upper corner of Form1

Set Your Form Properties Choose the Form1.cs[Design] Choose anywhere inside form Form1 Choose Text, type Picture Viewer

Lay Out Your Form View->Toolbox Containers TableLayoutPanel Double click

Choose the Alphabetical button Dock property None->Fill

Choose Triangle-> Edit Rows and Columns Row1 90 % Row2 10%

Insert PictureBox Choose Dock in Parent Container PictureBox->Dock->Fill PictureBox->ColumnSpan->2 PictureBox-BorderStyle->Fixed3D

Double Click CheckBox Container Text->Stretch FlowLayoutPanel Dock->Fill

To Add Buttons Choose FlowLayoutPanel Double Click Button to Add Set Text Close, Set BG Color, Clear, Show AutoSize=true

Name Your Button Controls choose button (name) closeButton backgroundButton clearButton showButton Double click showButton

private void clearButton_Click(object sender, EventArgs e) { } private void backgroundButton_Click(object sender, EventArgs e) { } private void closeButton_Click(object sender, EventArgs e) { } private void checkBox1_CheckedChanged(object sender, EventArgs e) { }

Add Dialog Components Dialogs double click openFileDialog, colorDialog

openFileDialog Filter JPEG Files (*.jpg)|*.jpg|PNG Files (*.png)|*.png|BMP Files (*.bmp)|*.bmp|All files (*.*)|*.* Title Select a picture file

Write Code private void showButton_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) pictureBox1.Load(openFileDialog1.FileName); } private void closeButton_Click(object sender, EventArgs e) this.Close();

private void clearButton_Click(object sender, EventArgs e) { // Clear the picture. pictureBox1.Image = null; } private void backgroundButton_Click(object sender, EventArgs e) if (colorDialog1.ShowDialog() == DialogResult.OK) pictureBox1.BackColor = colorDialog1.Color;

private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (checkBox1.Checked) pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; else pictureBox1.SizeMode = PictureBoxSizeMode.Normal; }