Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

25
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    218
  • download

    0

Transcript of Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Page 1: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.
Page 2: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Create WindowsCreate Windows®® Applications with .NETApplications with .NET

Allan KnudsenAllan Knudsen

.NET Developer Evangelist.NET Developer Evangelist

MicrosoftMicrosoft

Page 3: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

AgendaAgenda

Windows Forms OverviewWindows Forms Overview Graphical EnhancementsGraphical Enhancements Browser IntegrationBrowser Integration Auto-Deployment Auto-Deployment

Page 4: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Session PrerequisitesSession Prerequisites Experience with Visual BasicExperience with Visual Basic®® 6.0, 6.0,

Visual Basic .NET, Visual C#Visual Basic .NET, Visual C#™™ or or Visual C++Visual C++®®

Experience developing Desktop Experience developing Desktop ApplicationsApplications

Page 5: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

AgendaAgenda Windows Forms OverviewWindows Forms Overview Graphical EnhancementsGraphical Enhancements Browser IntegrationBrowser Integration Auto-Deployment Auto-Deployment

Page 6: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Windows FormsWindows FormsIntroductionIntroduction

A framework for building Windows applications A framework for building Windows applications that takes advantage of all the power of .NET that takes advantage of all the power of .NET Framework and the Win32Framework and the Win32®® API API

An architecture for controls and containersAn architecture for controls and containers RAD design time experience - integrated RAD design time experience - integrated

designer supportdesigner support .NET Framework built with design-time in mind.NET Framework built with design-time in mind Design-time built using .NET Framework: Design-time built using .NET Framework:

Visual StudioVisual Studio®® .NET Property Browser, .NET Property Browser, Server Explorer, Windows Forms DesignerServer Explorer, Windows Forms Designer

No more hiding of Form Designer CodeNo more hiding of Form Designer Code

Page 7: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Windows FormsWindows FormsDocking and AnchoringDocking and AnchoringAnchoringAnchoring

When a Form is resized the controls on the When a Form is resized the controls on the form automatically resize and maintain form automatically resize and maintain positionposition

Allows you to anchor againstAllows you to anchor against Top and Left, Top and Right, All Corners, Etc.Top and Left, Top and Right, All Corners, Etc.

DockingDocking Allows you to set the side of it’s container a Allows you to set the side of it’s container a

control is attached tocontrol is attached to

Page 8: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Windows FormsWindows FormsInheritanceInheritance

Allows you to create one form based on Allows you to create one form based on the properties, etc of anotherthe properties, etc of another

Ability to Ability to Add InheritedAdd Inherited forms within the forms within the designerdesigner Allows you to pick the form from which you Allows you to pick the form from which you

want to inheritwant to inherit

Can specify a form in codeCan specify a form in code public class Form2 : winapp2.Form1public class Form2 : winapp2.Form1

Page 9: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Building Windows Building Windows Forms Applications Forms Applications Demonstration #1Demonstration #1

Page 10: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

AgendaAgenda Windows Forms OverviewWindows Forms Overview Graphical EnhancementsGraphical Enhancements Browser IntegrationBrowser Integration Auto-Deployment Auto-Deployment

Page 11: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Graphical EnhancementsGraphical EnhancementsFeaturesFeatures

Rich set of controlsRich set of controls Advanced graphics support – GDI+Advanced graphics support – GDI+

TransparencyTransparency Non-Rectangular WindowsNon-Rectangular Windows

Supports both Flat (Office XP) and 3D style Supports both Flat (Office XP) and 3D style control stylescontrol styles

Advanced layout Advanced layout Printing supportPrinting support Extensible:Extensible:

Extend and enhance controls and frameworkExtend and enhance controls and framework Easy to add design time behaviorEasy to add design time behavior Drop into Win32Drop into Win32

Page 12: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Using GDI+ from Using GDI+ from Visual Basic .NETVisual Basic .NETDemonstration #2Demonstration #2

Page 13: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

AgendaAgenda Windows Forms OverviewWindows Forms Overview Graphical EnhancementsGraphical Enhancements Browser IntegrationBrowser Integration Auto-Deployment Auto-Deployment

Page 14: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Browser IntegrationBrowser IntegrationBasicsBasics

Create the Windows Forms ControlsCreate the Windows Forms Controls Create an HTML document with an Create an HTML document with an

<object> tag<object> tag <object id=“SimpleControl” <object id=“SimpleControl”

classid=“http://localhost/myControls/classid=“http://localhost/myControls/myControl.dll#MyControlNamespace.myControl.dll#MyControlNamespace.MyControlClass>MyControlClass>

Create the Virtual Directory and Set Create the Virtual Directory and Set PermissionsPermissions

Page 15: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Browser IntegrationBrowser IntegrationSmart ClientSmart Client

““No Touch” deploymentNo Touch” deployment Application isolation is the defaultApplication isolation is the default No registration requiredNo registration required Versioning – no side effectsVersioning – no side effects Web-based deploymentWeb-based deployment

SecureSecure Safe to run downloaded codeSafe to run downloaded code

Page 16: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Browser IntegrationBrowser IntegrationSecuritySecurity Code access security makes Code access security makes

Windows Forms controls safeWindows Forms controls safe Execution controlled by:Execution controlled by:

PermissionsPermissions Permission Sets Permission Sets Code Groups (Zones)Code Groups (Zones) Code groups have permission setsCode groups have permission sets

Page 17: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Browser IntegrationBrowser IntegrationHosting ControlsHosting Controls

Controls can be hosted Internet Explorer 5.5 Controls can be hosted Internet Explorer 5.5 or aboveor above

Low impact Low impact No installation, registration or GUIDsNo installation, registration or GUIDs

Secure Secure Code access security prevents harmCode access security prevents harm No Internet Explorer security dialogs!No Internet Explorer security dialogs!

Lightweight Lightweight “ “Hello World” ~ 3.5KHello World” ~ 3.5K

Easily deployedEasily deployed Dependent components download automaticallyDependent components download automatically

Page 18: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Browser IntegrationBrowser IntegrationControls in the BrowserControls in the Browser

Web ServerWeb Server

Web Web ServerServer

Assembly Assembly CacheCache

HTTPHTTP

Chart.htmlChart.html

ChartEngine.DLLChartEngine.DLLCustomizer.DLLCustomizer.DLL

ClientClient

HTTPHTTP

Internet Explorer 5.5Internet Explorer 5.5

Charting.DLLCharting.DLL

Page 19: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Controls in the Controls in the BrowserBrowserDemonstration #3Demonstration #3

Page 20: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

AgendaAgenda Windows Forms OverviewWindows Forms Overview Graphical EnhancementsGraphical Enhancements Browser IntegrationBrowser Integration Auto-DeploymentAuto-Deployment

Page 21: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Auto-DeploymentAuto-Deployment Smart ClientSmart Client

Dependent components download Dependent components download automaticallyautomatically Application “trickles” onto the clientApplication “trickles” onto the client

No installation No installation Use Assembly.LoadFromUse Assembly.LoadFrom

Stored in the Download cacheStored in the Download cache Only downloaded when updatedOnly downloaded when updated

Page 22: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Auto DeploymentAuto Deployment

Web ServerWeb Server

Web Web ServerServer

Assembly Assembly CacheCache

HTTPHTTP

Smart ClientSmart Client

Windows Forms AppWindows Forms App

Form1Form1

Form2Form2

Page 23: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Auto-DeploymentAuto-DeploymentDemonstration #4Demonstration #4

Page 24: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.

Session SummarySession Summary

Windows Forms controls are secure, Windows Forms controls are secure, lightweight, and support hosting lightweight, and support hosting on Web pageson Web pages

Windows Forms applications are easy Windows Forms applications are easy to write and deployto write and deploy

Page 25: Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.