Visual Studio.NET Part 2 dbg --- Using the VS.NET Integrated Development Environment.

Slides:



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

CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Chapter 1: An Introduction to Visual Basic 2012
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Chapter 6 Multiform Projects Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
CGS 1060 Introduction to MicroComputer Usage Chapter 1 Windows 7
Chapter 1: An Introduction to Visual Basic.NET Programming with Microsoft Visual Basic.NET, Second Edition.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 1 Tariq Aziz and Kevin Jones.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Exploring the Basics of Windows XP
Access Tutorial 10 Automating Tasks with Macros
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
Microsoft Office 2010 Office 2010 and Windows 7: Essential Concepts and Skills.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Microsoft Office 2003 Illustrated Introductory with Programs, Files, and Folders Working.
Office 2013 and Windows 8: Essential Concepts and Skills
CIS—100 Chapter 15—Windows Vista 1. Parts of a Window 2.
IE 411/511: Visual Programming for Industrial Applications
Chapter 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
Microsoft Windows 7 Essential Introduction to Windows 7.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
2. Introduction to the Visual Studio.NET IDE. Chapter Outline Overview of the Visual Studio.NET IDE Overview of the Visual Studio.NET IDE Menu Bar and.
Lecture Set 1 Part C: Understanding Visual Studio and.NET – Applications, Solutions, Projects (no longer used – embedded in Lecture Set 2A)
XP New Perspectives on Windows XP Tutorial 1 Exploring the Basics.
Visual Studio.NET Part 2 dbg --- Using the Integrated Development Environment.
Introduction to the Visual Studio.NET IDE (LAB 1 )
Computing Fundamentals Module Lesson 3 — Changing Settings and Customizing the Desktop Computer Literacy BASICS.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
XP New Perspectives on Microsoft Windows 2000 Professional Windows 2000 Tutorial 1 1 Microsoft Windows 2000 Professional Tutorial 1 – Exploring the Basics.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Multiform Projects.
Exploring Windows and Essential Computing Concepts 1 Windows Desktop u Windows Basics u Icon u Start Button u My Computer u Network Neighborhood u Recycle.
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
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.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 7 – Creating and Using Templates in a Web.
® Microsoft Office 2010 Exploring the Basics of Microsoft Windows 7.
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.
CMPF124: Basics Skills for Knowledge Workers Manipulating Windows GUI.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
Microsoft Office 2010 is the newest version of Microsoft Office, offering features that provide users with better functionality and easier ways to work.
Forms and Controls Part 3 dbg --- Naming conventions, Button, Event handlers, Label.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
 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 Office 2010 Exploring the Basics of Microsoft Windows 7.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
Object-Oriented Application Development Using VB.NET 1 Chapter 2 The Visual Studio.NET Development Environment.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
Forms and Controls Part 3 dbg --- Naming conventions, Button, Event handlers, Label.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
Creating New Forms Projects can appear more professional when using different windows for different types of information. Select Add Windows Form from.
XP New Perspectives on Microsoft Windows XP Tutorial 1 1 Microsoft Windows XP Creating a Web Site Tutorial 1.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Office 2013 and Windows 8: Essential Concepts and Skills Microsoft Office 2013.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Based On Murach’s slides
Chapter 1: An Introduction to Visual Basic .NET
Chapter 2: The Visual Studio .NET Development Environment
1. Introduction to Visual Basic
CIS16 Application Development Programming with Visual Basic
Microsoft Windows 7 Basics
Presentation transcript:

Visual Studio.NET Part 2 dbg --- Using the VS.NET Integrated Development Environment

2 Visual Studio.NET A development “shell” for creating applications –Visual designer –Context editor with Intellisense for typing code –Programming language compilers –Run/Debug environment

3 Visual Studio.NET We will use Visual Studio.NET and the C# programming language to develop Graphical User Interface (GUI) applications. Notice that GUIs look very different from the console applications you made in CIS202.

4 Installing Visual Studio.NET 2005 If you have Windows XP with Service Pack 2, Windows Vista, or a Macintosh Computer running Windows XP via Bootcamp or Parallels, you can install Visual Studio V2005. Obtain 2 CDROMs from School of Math & Science office (2 nd floor, Madison Avenue end of Science Center). Follow the provided instructions.

5 Starting Visual Studio.NET 1.Start Visual Studio.NET from a Desktop shortcut. -or- 2., Programs:

6 Creating a New Project

7 Select a Language

8 Select a Template

9 Assign Path and Meaningful Name

10 The Visual Studio IDE

11 Adjust the View in the IDE To undock a docked window so it floats on the screen, drag it by its title bar away from the edge of the application window or double-click its title bar. Double-click a window’s title bar to return the window to its default location. To hide a docked window, click its Auto Hide button. The window will be displayed as a tab at the edge of the screen. You can redisplay it by placing the mouse pointer over the tab. To return all windows to their original Visual Studio positions, choose Window, Reset Window Layout in the menu.

12 Setting Default Location for Projects Choose Tools, Options in the menu. Click the + in front of Projects and Solutions. Click General under Projects and Solutions. Click the Browse button next to Visual Studio projects location: and choose the folder you created for this course. Make a folder on drive c: rather than in My Documents!

13 Visual Studio Solutions A solution is comparable to a workspace in C++ V6. The first project created in the solution gives its name to the solution and thus to the namespace as well. At times, it may be advisable to change the name of either the project or the namespace.

14 The Designer View The IDE displays a design-time view of the visible portion, if any, of the object being designed. A Designer view of a form object appears by default in a new project. The form will be a window at run time.

15 The Code View The IDE provides an editor for building the actual code for the class or classes that make up your new project. Pre-existing (library) code is not visible here. Choose View Code icon in Solution Explorer or click Code tab in Designer Window.

16 Adjusting Properties at Design Time The IDE provides a convenient window for assigning values to object properties at design time. The Properties Window displays all available properties for any object that is selected within the IDE. Use F4 or View, Properties Window from menu, if the Properties Window is not visible.

17 Some Form Properties A number of form properties can be changed at design time. Dimensions of the form can be adjusted by dragging the selection handles or by assigning values to the Size Property in the property window. The screen position of the window can be adjusted by choosing values for the StartPosition property.

18 More Form Properties Every form should have a Text property that reflects the role of the form in the project; the text typed as the Text Property appears in the Titlebar of the window. The form icon can also be changed by assigning a new icon file to the Icon property; later, we will learn how to create a custom icon.  FormWithChangedProperties

19 Compiling and Running Choose Build, Build Solution from menu to compile without running. 3 ways to run (and build, if necessary) an application: –Choose Debug, Start Debugging from menu –Press F5 –Click the Debug tool in the toolbar

20 The Compilation Process

21 The Window Control Box When the Windows Application project runs, the form appears as a Window object. The project remains running until the window is closed. The window can be closed by clicking the in the Control Box in the Titlebar.

22 The Window Control Box The Control Box also contains icons for minimizing the window to a taskbar item and maximizing the window to full screen size. The Maximize icon becomes a Restore Down icon if the window is maximized. All, some, or none of these icons may be displayed by setting the ControlBox, MinimizeBox, and/or MaximizeBox properties to true or false.  ControlBox Minimize Maximize Restore Down Close

23 Show in TaskBar You may not wish to have a Taskbar item appear to represent your window. Setting the Show in TaskBar property to False at design time will accomplish this.

24 Let’s Review C++ File Structure Before looking at the C#.NET V2005 file structure of the project we just created, we’ll review how C++ V6 and. NET versions of projects look in My Computer.

File Structure of a C++ V6 or.NET Console Application HW777.dsw or (.sln) HW777.ncb HW777.dsp HW777.plg HW777.opt source.cpp HW777.exe * source.obj * HW777.pdb HW777.pch * HW777.ilk vc60.pdb vc60.idb * Note: Debug folder contains all 7 subfiles. Release folder only contains 4 asterisked subfiles. HW777 Debug or Release

26 Structure of a C# Solution The IDE creates a collection of files called a solution. Normally, a solution contains one project. A project generates an application. Multiple projects may be contained within one solution.

27 C#.NET V2005 Solution Explorer Window

28 Let’s Look at C# V2005 File Structure Now we’ll look at how the C#.NET V2005 project we just created looks in My Computer.

29 File Structure of C#.NET V2005 Project

HW999binobjPropertiesDebug HW999.sln HW999.suo HW999.csproj HW999.exe frmDeesDiner.cs frmDeesDiner.Designer.cs Program.cs frmDeesDIner.resx File Structure of a C#.NET V2005 Windows Application HW999

31 Important Files The project file (with an extension of.csproj) keeps track of the files that make up the project and records various settings for the project. The solution file (with an extension of.sln) keeps track of the projects that make up the solution. When you open a project file, Visual Studio opens the solution that contains the project. And when you open a solution file, Visual Studio automatically opens all the projects contained in the solution.

32 Form Files In C# 2005, each form is defined by two C# files. Each file contains a partial class. The file with the.cs extension contains the code that is entered by the programmer; the file with the Designer.cs extension contains the code that is generated when the programmer works with the Form Designer. When the project is compiled, these two partial classes are combined into a single class that determines the appearance and operation of the form.

33 Other Files A source code file that doesn’t define a form is usually stored in a single C# source file that contains a single class. The References folder contains references to the assemblies for the namespaces that the application can use. These namespaces contain the classes that the project requires. In most cases, all the references that you need are included when the project is created.

34 Opening a C#.NET V2005 Project from My Computer To open a project from My Computer, double- click the solution file (ex. Homework999.sln). The solution file (ex. Homework999.sln), which is a file that contains pointers to all Projects within a Solution, is now stored outside of the Project folder.

35 Opening a C#.NET V2005 Project from Visual Studio.NET

36 ing Assignments to Professor When ing an assignment to me, you must submit the circled folder and all of its contents. You should “zip” this folder into 1 file for easy transmission using a program like WinZip, 7- Zip, ZipItFree, or JZip. The course website has links to the appropriate download sites.

37 “Zipping” a Folder via WinZip 1.Navigate to folder in My Computer. 2.Right-click and choose WinZip from context menu. 3.Choose 2 nd option, Add to Homework999.zip. 4.One file, Homework999.zip, containing the contents of entire Homework999 folder, is created.

38 Start a New Message 1.Start and click New message. Add professor address in To: area and assignment number in Subject: area.

39 Adding.zip File as an Attachment 1.Click in message toolbar. You will see the Attachments dialog. 2.Browse for your.zip file.

40 Adding.zip File as an Attachment 1.After the file name displays in Choose a file to attach box, click the Attach button. 2.The.zip file will then show as a Current File Attachment. Click the Close button.

41 Send Message Your message should now display the attached.zip file. Send the message.

Events Application Lifetime and Object Responses to Stimuli

43 Event-Driven Applications Objects can both send, and react to, special messages or stimuli called events. By and large, event-driven applications run until they are stopped by user intervention. Event driven applications respond to any events that they detect.

44 Events EventOccurs when… Common control events Click…the user clicks the control Double-click…the user double-clicks the control Enter…the focus is moved to the control Leave...the focus is moved from the control Common form events Load…the form is loaded into memory Closing…the form is closing Closed…the form is closed

45 Reacting to a Click Event An object can react to the event caused by clicking the mouse. Objects react to events by executing code within a special method (function) called an event handler. A specific event (clicking this object) causes the event handler to run. Any instructions coded within the event handler are then executed.  FirstEvent

46 Associating Handlers with Events An event handler is a method (function) that contains the code that will be executed when a particular event occurs for the a specific object. Event handlers may be associated with objects and their events in several ways: –The default handler for a control (often the Click event handler) will be added automatically to the code area, when you double-click the control in the Designer View. –Or, you may double-click a particular event in the Properties Window.

47 Associating Events via the Property Window A list of all available events for an object is available in the Properties window if the is toggled. Double-click the appropriate event. Selecting an event here causes an event handler skeleton to be created in the code area.

48 A New Handler Function Event Handler methods are named with a combination of the object and the event.

49 “Event Wiring” A separate line of code is automatically written (in the Windows Generated Code region of the formName.Designer.cs file) to connect the event handler to the event. You can think of this as “event wiring” or “automatic registration” of the event handler method.

50 Structure of a Handler An event handler is a void method with two arguments. The sender argument of type Object represents the originator of the event.

51 Structure of a Handler The e argument of type EventArgs represents the set of data fields, if any, that arrive with the event. EventArgs fields vary with the class that originates, or raises, the event.