BIL528 – Bilgisayar Programlama II Introduction 1.

Slides:



Advertisements
Similar presentations
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Advertisements

Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
© by Pearson Education, Inc. All Rights Reserved. continued …
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
Compunet Corporation Programming with Visual Studio.NET GUI Week 13 Tariq Aziz and Kevin Jones.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 2 Tariq Aziz and Kevin Jones.
Compunet Corporation Programming with Visual Basic.NET GUI Week # 11 Tariq Ibn Aziz.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
BİL528 – Bilgisayar Programlama II Advanced Controls, Menus, Toolbars, and Status Bars 1.
Chapter 3 Introduction to Event Handling and Windows Forms Applications.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Microsoft Visual Basic 2012 CHAPTER TWO Program and Graphical User Interface Design.
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.
Windows Forms Programming in C# Windows Forms CSE 494R (proposed course for 459 Programming in C#) Prof. Roger Crawfis.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
IE 411/511: Visual Programming for Industrial Applications
Chapter 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
BIM211 – Visual Programming Objects, Collections, and Events 1.
1 1 Lab1 Ismail M. Romi – IT Dept, PPU, Visual Basic 2005 Programming Tour.
Intro to MFC. Open VS and create new project 1)Open MS Visual Studio 2008 Professional (It must be the Professional Edition, the Express Edition will.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
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.
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Copyright © 2001 by Wiley. All rights reserved. Chapter 2: Using Visual Basic to Create a First Project Getting Started with VB Development Environment.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
COS240 O-O Languages AUBG, COS dept Lecture 33 Title: C# vs. Java (GUI Programming) Reference: COS240 Syllabus.
Introduction It is developed to create software applications. It is a tool for developers of any program that uses both basic and expert settings. It.
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.
Chapter Two Creating a First Project in Visual Basic.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 3.1 Test-Driving the Welcome Application 3.2.
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
COMPUTER PROGRAMMING I SUMMER 2011 Objective 8.02 Apply Procedures to Create Picture Boxes using Images. (5%)
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
Visual Basic CDA College Limassol Campus Lecture:Pelekanou Olga Semester C Week - 1.
1 Visual Basic Part I - A tool for customizing your program Principles of GIS
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
Microsoft Visual Basic 2005 BASICS Lesson 3 Events and Code.
Chapter 3 I Need a Tour Guide (Introduction to Visual Basic 2010) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
BIL528 – Bilgisayar Programlama II Methods 1. Contents Methods 2.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
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.
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.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
 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 2008 Fourth Edition Chapter One An Introduction to Visual Basic 2008.
Dive Into® Visual Basic 2010 Express
Chapter 3: I Need a Tour Guide (Introduction to Visual Basic 2012)
Chapter 1: An Introduction to Visual Basic 2015
Chapter 2 – Introduction to the Visual Studio .NET IDE
3.01 Apply Controls Associated With Visual Studio Form
Visual programming Chapter 1: Introduction
3.01 Apply Controls Associated With Visual Studio Form
Visual studio 2010 SENG 403, Tutorial 2 SENG Winter 2011.
Picture Viewer.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Simple Windows Applications
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
GUI Programming in Visual Studio .NET
Presentation transcript:

BIL528 – Bilgisayar Programlama II Introduction 1

Contents Information about the course Visual Studio 2010 Environment Designing a Simple Visual C# Program 2

Course Information 3

Creating a New Project 4

5

6

7

8

The First Changes The Name property is the first property you should change when you add a new object to your project. Change the filename of the form from the Solution Explorer too. Note: When you change the filename, Visual Studio asks you to change the name of the form. 9

10

Changing the Title of the Form Changing the filename and name of the form does not change the title of the form which is displayed at the top-left corner of the window. You should change the title of the form using the Text property. 11

12

Giving the Form an Icon – In the Properties windows, change the Icon property of the form. Changing the Size of the Form – Change the Width and Height properties of the form under the Size property. – Both values are represented in pixels. – You can also size a form by dragging its border. 13

Adding Controls to the Form Use the Toolbox window. Some controls in the toolbox have visible interface, but some not. You can make the toolbox visible always by clicking the pushpin picture at the top- right corner. 14

Designing an Interface 1.Design the form’s user interface 2.Write the code behind the interface. This procedure is generally the best to design a form. 15

Adding a Visible Control to a Form Visible controls can be added in two ways: 1.By double-clicking the control 2.By dragging the control and dropping on the form. You can place the controls wherever you want by dragging them on the form. Let’s add two buttons and a PictureBox control to the form… 16

17 PropertyValue NamebtnSelectPicture Location295, 10 Size85, 23 TextSelect Picture PropertyValue NamebtnQuit Location295, 40 TextQuit PropertyValue NamepicShowPicture BorderStyleFixedSingle Location8, 8 Size282, 275

Adding an Invisible Control to a Form Not all controls have physical appearance. They are not designed for user interactivity. Examples: OpenFileDialog and SaveFileDialog controls You can add them to the control by the same way as the visible controls. They are shown below the form at design time but they are not shown at the runtime. 18

Adding an OpenFileDialog Control Add an OpenFileDialog control to the form and change the following properties: 19 PropertyValue NameofdSelectPicture Filename FilterWindows Bitmaps|*.BMP|JPEG Files|*.JPG TitleSelect Picture

20

Executing the Program Simply press Ctrl+F5 – Runs the program normally You can press F5 or click the debug button on the toolbar instead – But this runs the program in debug mode and it is a bit slower. Clicking the buttons does not do anything now because we didn’t write any code for them! 21

Writing the Code Behind an Interface Visual C# is an event-driven language, which means that code is executed in response to events. These events might come from users, such as a user clicking a button and triggering its Click event, or from Windows itself. 22

Letting a User Browse for a File When you double-click a control on a form in Design view, the default event for that control is displayed in a code window. The default event for a Button control is its Click event. Double-click the Select Picture button now to access its Click event in the code window. 23

24

The Content of the Method private void btnSelectPicture_Click(object sender, EventArgs e) { // Show the open file dialog box. if (ofdSelectPicture.ShowDialog() == DialogResult.OK) { // Load the picture into the picture box. picShowPicture.Image = Image.FromFile(ofdSelectPicture.FileName); // Show the name of the file in the form’s caption. this.Text = "Picture Viewer (" + ofdSelectPicture.FileName + ")"; } 25

Terminating a Program Using a Code Write the following code into the Click event of the Quit button: // Close the window and exit the application this.Close(); 26

27

Execution of the Program 28

Exercises Change your Picture Viewer program so that the user can also locate and select GIF files. (Hint: Change the Filter property of the OpenFileDialog control.) Change the background color of the form. Change the background color of the buttons. Change the color of the texts on the buttons. What happens if you try to display a larger image? How can you solve this problem? 29