Neal Stublen Practice Solution  Create a new solution  Add a WinForms project  Add a Class Library project  Reference the library.

Slides:



Advertisements
Similar presentations
 2007 Dr. Natheer Khasawneh. Chapter 13. Graphical User Interface Concepts: Part 1.
Advertisements

Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 9: Implementing and Using Group Policy.
Chapter 12: Using ADO.NET 2.0 Programming with Microsoft Visual Basic 2005, Third Edition.
Microsoft Windows Vista Chapter 6 Customizing Your Computer Using the Control Panel.
MDI windows Single-document-interface (SDI)
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 9: Implementing and Using Group Policy.
Multiple Document Interface (MDI) application
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 19 Microsoft’s Approach 1 –.NET Mobile Framework part 2 Rob.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
WORKING WITH MACROS CHAPTER 10 WORKING WITH MACROS.
CHAPTER SIX Loop Structures.
CHAPTER 6 Loop Structures.
CHAPTER SIX.
McGraw-Hill© 2007 The McGraw-Hill Companies, Inc. All rights reserved. 1-1.
Neal Stublen Overview of.NET Windows Applications Microsoft Windows OS / Intel Platform Windows Application File SystemNetworkDisplay.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 9: Implementing and Using Group Policy.
1 Graphical User Interfaces Part 2 Outline Multiple Document Interface (MDI) Windows Visual Inheritance User-Defined Controls.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Microsoft Visual Basic 2005: Reloaded Second Edition
Neal Stublen Class Objectives  Develop an understanding of the.NET Framework  Gain proficiency using Visual Studio  Begin learning.
Getting Started with Application Software
IT 211 Project Integration and Deployment Lab #11.
Virtual techdays INDIA │ Nov 2010 Developing Office Biz Application using WPF on Windows 7 Sarang Datye │ Sr. Consultant, Microsoft Sridhar Poduri.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
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.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 13 – Graphical User Interfaces Part 2 Outline.
Graphical User Interface Concepts - Part 2 Session 09 Mata kuliah: M0874 – Programming II Tahun: 2010.
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.
CS 346 – Chapter 4 Threads –How they differ from processes –Definition, purpose Threads of the same process share: code, data, open files –Types –Support.
Chapter 5: More on the Selection Structure Programming with Microsoft Visual Basic 2005, Third Edition.
Chapter Two Creating a First Project in Visual Basic.
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
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 C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 14 Threads 2 Read Ch.
Understanding Desktop Applications Lesson 5. Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding Windows Forms Applications Understand.
Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi Chapter 2 Introduction to Visual Basic Programming Visual Basic.NET.
Lecture Set 2 Part A: Creating an Application with Visual Studio – Solutions, Projects, Files 8/10/ :35 PM.
Overview of Previous Lesson(s) Over View 3 Program.
Understanding Desktop Applications Lesson 5. Understanding Windows Forms Applications Windows Forms applications are smart client applications consisting.
1 15. Building Applications with Windows Forms Why Use Windows Forms? Structure of Windows Forms Using Windows Forms Using Controls Code Samples.
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.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 6 Looping and Multiple Forms.
ClickOnce Deployment (One-click Deployment)
Dive Into® Visual Basic 2010 Express
Chapter 2: The Visual Studio .NET Development Environment
Getting Started with Application Software
Using Procedures and Exception Handling
Standard Controls.
CIS16 Application Development Programming with Visual Basic
Creating a Windows Forms User Interface
How to organize and document your classes
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
ClickOnce Deployment (One-click Deployment)
Chapter 4 Enhancing the Graphical User Interface
Presentation transcript:

Neal Stublen

Practice Solution  Create a new solution  Add a WinForms project  Add a Class Library project  Reference the library from the WinForms project

XCopy  Simple file copy  Dependencies must already be installed (e.g..NET Framework)  Won’t install Start menu icons, etc.

Using XCopy Deployment  Defaults of bin\Debug, bin\Release within project folder  $(SolutionDir), $(ProjectDir), etc. us/library/c02as0cs.aspx us/library/c02as0cs.aspx  $(SolutionDir)_Output\Debug\$(TargetFileName)  $(SolutionDir)_Output\Release\$(TargetFileName)  C:\Stage\$(SolutionName)\Debug\$(TargetFileName)  C:\Stage\$(SolutionName)\Release\$(TargetFileName)

ClickOnce  Install from a link on a web page  Adds Start menu shortcuts, etc.  Adds entry to Programs and Features for changing and uninstalling the application  Automatic updates

Setup  Create a setup program to be run from the user’s computer  Install components to the GAC (global assembly cache)  Modify the registry  Create a setup program when ClickOnce is not adequate  Discontinued after VS2010

Global Assembly Cache  Machine wide assembly storage  Stores assemblies that are shared by several applications on the computer  %WINDIR%\Microsoft.NET\assembly or %WINDIR%\assembly

WiX Toolset  Windows Installer XML Toolset  Alternative to discontinued Setup projects 

When To Use Them?  Create compound controls  Create specialized controls with modified behavior

User Control Properties  Override UserControl properties  [Browsable(true)]  [EditorBrowsable(EditorBrowsableState.Always)]  [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]  [Bindable(true)]

Code Practice  Create a Label that turns into a TextBox when clicked  Create a User Control Library  Add a Label to the form  Add a TextBox to the form Visible = false  Override Text property of UserControl to update Label  Handle Click event to edit Label Text  Handle Enter key to finish editing

Code Practice  Handle Escape key to cancel editing  Handle loss of focus to cancel editing  Create an event to signal a text change  Ensure Text and TextChanged are visible in the designer

Extend Existing Classes public static class Extensions { public string ToTitleCase(string inText) { } public int WordCount(string inText) { } string title = Extensions.ToTitleCase(title); int count = Extensions.WordCount(title);

Extend Existing Classes public static class Extensions { public static string ToTitleCase(this string inText) { } public static int WordCount(this string inText) { } string title = title.ToTitleCase(); int count = title.WordCount();

Thread Class  Create a new thread to execute some background task Thread t = new Thread(new ThreadStart(ThreadProc_); t.Start(); // Do some other stuff... t.Join(); public static void ThreadProc() { }

Code Practice  Create a new project  Create a method that will write the numbers 1 to 10 to the console  Create a secondary thread that will call this method  Start the thread  Call the method on the primary thread  Join the thread

Code Practice  Modify the method that writes to the console to update a shared integer value 100 times  Run the program and write the counter value to the console

lock Synchronization  The lock statement allows us to guard access to an object

Code Practice  Update the previous example to prevent concurrent access to the counter

BackgroundWorker  The BackgroundWorker control provides a way to add background functionality to a form  Handler to do work on a background thread  Handlers to report progress and catch completion  IsBusy confirms background process is running  Call RunWorkerAsync() from primary thread

BackgroundWorker Progress  Call ReportProgress within DoWork handler

Cancel BackgroundWorker  Call CancelAsync () from primary thread  Check CancellationPending property within DoWork handler  Set Cancel property to true in DoWorkEventArgs  Exit DoWork handler

Code Practice  Create a BackgroundWorker that just updates a progress bar

Async Pattern class Example { // Synchronous method call public bool LongMethod(string param); // Asynchronous method call public void LongMethodAsync(string param); public event LongMethodCompletedEventHandler LongMethodCompleted; }

Multiple Document Interface  Word can be changed from SDI (all documents appear on taskbar) to MDI (single taskbar icon)  Often replaced by separate top-level Windows or a tabbed interface (e.g. Visual Studio)

Using MDI  Set IsMdiContainer to true on parent form  Set MdiParent property on child forms at runtime  Parent’s ActiveMdi property indicates the currently active child form  Parent’s LayoutMdi property can arrange the child forms