 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.

Slides:



Advertisements
Similar presentations
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Advertisements

Chapter 1: An Introduction to Visual Basic 2012
Using Macros and Visual Basic for Applications (VBA) with Excel
© by Pearson Education, Inc. All Rights Reserved.
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,
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
 2002 Prentice Hall. All rights reserved. Chapter 2 - Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Overview of the Visual Studio.NET.
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.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Microsoft Visual Basic 2012 CHAPTER TWO Program and Graphical User Interface Design.
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.
Learning Microsoft Power Point Getting Started  There are three features that you should remember as you work within PowerPoint 2007: the Microsoft.
Committed to Shaping the Next Generation of IT Experts. Exploring Microsoft Office Word 2007 Chapter 3: Enhancing a Document Robert Grauer, Keith Mulbery,
IE 411/511: Visual Programming for Industrial Applications
Chapter 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
 Computer use is increasing in almost every field  Computing costs have been decreasing dramatically due to rapid developments in hardware, software.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 2 Welcome Application Introducing the Visual Basic 2008 Express Edition IDE.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
 2009 Pearson Education, Inc. All rights reserved Introduction to the Visual Basic Express 2008 IDE.
 2009 Pearson Education, Inc. All rights reserved Dive Into ® Visual C# 2008 Express.
Jozef Goetz,  2006 Pearson Education, Inc. All rights reserved.  2002 Prentice Hall. All rights reserved. expanded by J. Goetz, 2009.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
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.
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.
Working with Graphics – Lesson 21 Working with Graphics Lesson 2.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 3.1 Test-Driving the Welcome Application 3.2.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
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.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
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.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 4 Designing the Inventory Application Introducing TextBox es and Button s.
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.
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Chapter 2 Creating Applications with Visual Basic.
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.
Committed to Shaping the Next Generation of IT Experts. Exploring Microsoft Office Word 2007 Chapter 3: Enhancing a Document Robert Grauer, Keith Mulbery,
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.
Opening a File 1.Open Word 2.Click the Microsoft Office button(Very top left hand corner). A menu appears 3.Click Open. The Open dialog box appears 4.Use.
 2007 Pearson Education, Inc. All rights reserved Introduction to the Visual Basic Express 2005 IDE.
Programming with Microsoft Visual Basic 2012 Chapter 1: An Introduction to Visual Basic 2012.
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 .NET
Chapter 1: An Introduction to Visual Basic 2015
Chapter 2 – Introduction to the Visual Studio .NET IDE
Program and Graphical User Interface Design
Objective 8.02 Apply Procedures to Create Picture Boxes using Images.
Introduction to the Visual C# 2005 Express Edition IDE
Program and Graphical User Interface Design
Chapter 2 – Introduction to the Visual Studio .NET IDE
Visual Studio.
Presentation transcript:

 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 clicking, dragging and dropping) to generate program code. © by Pearson Education, Inc. All Rights Reserved.

 Visual programming is useful for building GUI- intensive programs that require user interaction.  To create, save, run and terminate this first program, perform the following steps: © by Pearson Education, Inc. All Rights Reserved.

 Closing the open project. If a project is already open, close it by selecting File > Close Project. A dialog asking whether to save the current project might appear. Click Save to save your changes or Discard to ignore them.  Creating the new project. To create a new Windows Forms application for the program, select File > New Project… to display the New Project dialog. Select Windows Forms Application. Name the project ASimpleProgram and click OK. © by Pearson Education, Inc. All Rights Reserved.

 Saving the project. We mentioned earlier in this chapter that you must set the directory in which the project is saved. To specify the directory in Visual Basic 2010 Express, select File > Save All to display the Save Project dialog. © by Pearson Education, Inc. All Rights Reserved.

 By default, projects are saved to your user directory in the folder Documents\Visual Studio 2010\Projects. To change the project location, click the Browse… button, which opens the Project Location dialog. Navigate through the directories, select one in which to place the project (in our example, we use the directory C:\MyVBProjects ) and click Select Folder to close the dialog. Click Save in the Save Project dialog to save the project and close the dialog. © by Pearson Education, Inc. All Rights Reserved.

 When you first begin working in the IDE, it is in design mode (that is, the program is being designed and is not executing).  This provides access to all the environment windows (for example, Toolbox, Properties ), menus and toolbars, as you’ll see shortly. © by Pearson Education, Inc. All Rights Reserved.

 Setting the text in the Form ’s title bar. The text in the Form ’s title bar is determined by the Form ’s Text property. If the Properties window is not open, click the properties icon in the toolbar or select View > Other Windows > Properties Window. Click anywhere in the Form to display the Form ’s properties in the Properties window. In the textbox to the right of the Text property, type "A Simple Program", as in. Press the Enter key—the Form ’s title bar is updated immediately. © by Pearson Education, Inc. All Rights Reserved.

 Resizing the Form. Click and drag one of the Form ’s enabled sizing handles (the small white squares that appear around the Form ). Using the mouse, select the bottom-right sizing handle and drag it down and to the right to make the Form larger. © by Pearson Education, Inc. All Rights Reserved.

 Changing the Form ’s background color. The BackColor property specifies a Form ’s or control’s background color. Clicking BackColor in the Properties window causes a down-arrow button to appear next to the value of the property. When clicked, the down-arrow button displays other options, which vary depending on the property. © by Pearson Education, Inc. All Rights Reserved.

 Adding a Label control to the Form. If the Toolbox is not already open, select View > Other Windows > Toolbox to display the set of controls you’ll use for creating your programs. For the type of program we’re creating in this chapter, the typical controls we use are located in either the All Windows Forms group of the Toolbox or the Common Controls group. If either group name is collapsed, expand it by clicking the arrow to the left of the group name. © by Pearson Education, Inc. All Rights Reserved.

 Next, double click the Label control in the Toolbox. This action causes a Label to appear in the upper-left corner of the Form. ◦ [Note: If the Form is behind the Toolbox, you may need to hide the Toolbox to see the Label.]  Although double clicking any Toolbox control places the control on the Form, you also can “drag” controls from the Toolbox to the Form —you may prefer dragging the control because you can position it wherever you want. © by Pearson Education, Inc. All Rights Reserved.

 The Label displays the text Label1 by default. The Label ’s background color is the same as the Form ’s background color. When a control is added to the Form, its BackColor property is set to the Form ’s BackColor. You can change the Label ’s background color by changing its BackColor property. © by Pearson Education, Inc. All Rights Reserved.

 Customizing the Label ’s appearance. Select the Label by clicking it. Its properties now appear in the Properties window. The Label ’s Text property determines the text (if any) that the Label displays. The Form and Label each have their own Text property— Form s and controls can have the same types of properties (such as BackColor, Text, etc.) without conflict. Set the Label ’s Text property to Welcome to Visual Basic!. The Label resizes to fit all the typed text on one line. © by Pearson Education, Inc. All Rights Reserved.

 By default, the AutoSize property of the Label is set to True, which allows the Label to update its size to fit all of the text if necessary. Set the AutoSize property to False so that you can resize the Label on your own. Resize the Label (using the sizing handles) so that the text fits. Move the Label to the top center of the Form by dragging it or by using the keyboard’s left and right arrow keys to adjust its position. Alternatively, when the Label is selected, you can center the Label control horizontally by selecting Format > Center In Form > Horizontally. © by Pearson Education, Inc. All Rights Reserved.

 Setting the Label ’s font size. To change the font type and appearance of the Label ’s text, select the value of the Font property, which causes an ellipsis button to appear next to the value. When the ellipsis button is clicked, a dialog that provides additional values—in this case, the Font dialog—is displayed. You can select the font name (the font options may be different, depending on your system-), font style ( Regular, Italic, Bold, etc.) and font size ( 16, 18, 20, etc.) in this dialog. © by Pearson Education, Inc. All Rights Reserved.

 The Sample text shows the elected font settings. Under Font, select Segoe UI, Miscrosoft’s recommended font for user interfaces. Under Size, select 24 points and click OK. If the Label ’s text does not fit on a single line, it wraps to the next line. Resize the Label vertically if it’s not large enough to hold the text. You may need to center the Label horizontally again after resizing. © by Pearson Education, Inc. All Rights Reserved.

 Aligning the Label ’s text. Select the Label ’s TextAlign property, which determines how the text is aligned within the Label. A three-by-three grid of buttons representing alignment choices is displayed. The position of each button corresponds to where the text appears in the Label. © by Pearson Education, Inc. All Rights Reserved.

 For this program, set the TextAlign property to MiddleCenter in the three-by-three grid—this selection causes the text to appear centered in the middle of the Label, with equal spacing from the text to all sides of the Label. The other TextAlign values, such as TopLeft, TopRight, and BottomCenter, can be used to position the text anywhere within a Label. Certain alignment values may require that you resize the Label larger or smaller to better fit the text. © by Pearson Education, Inc. All Rights Reserved.

 Adding a PictureBox to the Form. The PictureBox control displays images. The process involved in this step is similar to that of Step 7, in which we added a Label to the Form. Locate the PictureBox in the Toolbox and double click it to add it to the Form. When the PictureBox appears, move it underneath the Label, either by dragging it or by using the arrow keys. © by Pearson Education, Inc. All Rights Reserved.

 Inserting an image. Click the PictureBox to display its properties in the Properties window. Locate the Image property, which displays a preview of the selected image or (none) if no image is selected. Click the ellipsis button to display the Select Resource dialog, which is used to import files, such as images, for use in a program. Click the Import… button to browse for an image to insert, select the image file and click OK. © by Pearson Education, Inc. All Rights Reserved.

 Supported image formats include PNG (Portable Network Graphics), GIF (Graphic Interchange Format), JPEG (Joint Photographic Experts Group) and BMP (Windows bitmap). To scale the image to the PictureBox ’s size, change the SizeMode property to StretchImage. Resize the PictureBox, making it larger. © by Pearson Education, Inc. All Rights Reserved.

 Saving the project. Select File > Save All to save the entire solution. The solution file (which has the file name extension.sln ) contains the name and location of its project, and the project file (which has the file name extension.vbproj ) contains the names and locations of all the files in the project. If you want to reopen your project at a later time, simply open its.sln file. © by Pearson Education, Inc. All Rights Reserved.

 Select Debug > Start Debugging- to execute the program (or you can press the F5 key). shows the IDE in run mode (indicated by the title-bar text ASimpleProgram (Running) – Microsoft Visual Basic 2010 Express Edition ). Many toolbar icons and menus are disabled, since they cannot be used while the program is running. © by Pearson Education, Inc. All Rights Reserved.

 Terminating execution. Click the running program’s close box (the X in the top-right corner of the running program’s window). This action stops the program’s execution and returns the IDE to design mode. You can also select Debug > Stop Debugging to terminate the program. © by Pearson Education, Inc. All Rights Reserved.