• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Moving to Microsoft Visual Basic .NET
 

Moving to Microsoft Visual Basic .NET

on

  • 12,258 views

Moving to Microsoft Visual Basic .NET

Moving to Microsoft Visual Basic .NET

Statistics

Views

Total Views
12,258
Views on SlideShare
12,203
Embed Views
55

Actions

Likes
5
Downloads
0
Comments
1

8 Embeds 55

http://fish70.wordpress.com 18
http://www.slideshare.net 14
http://www.techgig.com 14
http://127.0.0.1 3
http://static.slideshare.net 2
http://10.150.200.102 2
http://tutorialespr.blogspot.com 1
http://10.150.200.57 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • KEY MESSAGE: Opening slide. SLIDE BUILDS: None SLIDE SCRIPT: Hello and Welcome to this MSDN session on Moving to Visual Basic .NET. My name is {insert name} [Do not use the term FIELDCONTENT] SLIDE TRANSITION: This session will cover the following topics. ADDITIONAL INFORMATION FOR PRESENTER:

Moving to Microsoft Visual Basic .NET Moving to Microsoft Visual Basic .NET Presentation Transcript

  • Moving to Microsoft ® Visual Basic ® .NET Patrick McGowen Developer Evangelist Microsoft ® Corporation
  • What we will cover
    • Microsoft ® Visual Basic ® .NET
    • Windows Forms
    • Upgrading from Visual Basic 6
  • Session Prerequisites
    • Experience with Visual Basic
    • Experience building Microsoft ® Windows ® applications
    Level 200
  • Why Do This Presentation?
    • .NET changes everything
    • Upgrading is an involved process
  • Demonstrations
    • Overview of Key Visual Basic .NET Changes
    • Using the Upgrade Wizard
  • Demonstrations
    • Overview of Key Visual Basic .NET Changes
    • Implementing Drag-and-Drop Operations
    • Using the Upgrade Wizard
  • Agenda
    • An Overview of Visual Basic .NET
    • Developing Windows Applications
    • Upgrade Considerations
    • Upgrade Wizard
  • An Overview of Visual Basic .NET Not just Visual Basic 6 + 1
    • Designed for the .NET Framework
      • Common Language Runtime (mscoree.dll)
      • Base Class Library (mscorlib.dll + others)
    • Syntax modernized and cleaned up
    • New IDE
  • An Overview of Visual Basic .NET CLR: Key features
    • Cross-language interoperability
    • Shared types (Common Type System)
    • Replaces COM runtime layers
    • Uses garbage collection
    • Supports multithreading
    • Built-in security
  • An Overview of Visual Basic .NET Updated language: New features
    • Fully object-oriented
      • Implementation inheritance (“IsA”, “HasA”)
      • Improved interface inheritance
      • Overriding and Overloading
      • Parameterized constructers
    • SEH ( Try…Catch…Finally…End Try )
    • Shortcuts
      • Dim cnSql As New SqlConnection(strConn)
      • Private i,x,y As Int32
      • i+=1 , strName&=“Bob” , etc.
  • An Overview of Visual Basic .NET Updated language: Key changes
    • MessageBox.Show(“Hello World”)
    • ByRef or ByVal required
    • Event handlers use a Handles clause
    • Handles Button1.Click, Button2.Click
    • Event handlers have same signature
      • (sender As Object, e As xxx EventArgs)
    • Arrays must have 0-bound lower dimension
    • Property…End Property
  • An Overview of Visual Basic .NET Updated language: Cleaned up
    • Handled by the Upgrade Wizard, but don’t use
      • DefInt , DefStr , DefObj , DefDbl , DefLng
      • DefBool , DefCur , DefSng , DefDec , DefByte
      • Imp, Eqv
    • Handled, but use very sparingly
      • GoTo [Line no.]
    • Not handled by the Upgrade Wizard, so remove
      • GoSub…Return
      • LSet (for user-defined types)
      • VarPtr , ObjPtr , StrPtr
      • Null and Empty nonzero-lower-bound arrays
  • An Overview of Visual Basic .NET Updated language: Data type changes
    • Currency replaced by Decimal data type
    Long or Int64 64-bit Integer or Int32 Long 32-bit Short or Int16 Integer 16-bit Byte Byte 8-bit Visual Basic .NET Visual Basic 6.0 Integer Type
  • An Overview of Visual Basic .NET New IDE: Microsoft ® Visual Studio ® .NET
    • All languages share Devenv.exe
    • Includes Web development
    • Server Explorer
    • Dynamic Help
    • Greatly enhanced…
      • Task List ( ‘TODO: Use DataSet instead. )
      • IntelliSense
      • ToolBox
      • Debugger
    • Bottom Line: It’s still Visual Basic
    • Only executes within the CLR
    • RAD for both Windows and the Web
    • < 100% Backward compatibility
    • Visual Basic no longer unified with VBA
    • Ceases its focus as a COM “glue language”
    An Overview of Visual Basic .NET Final Comments
  • Demonstration 1 Key Visual Basic .NET Changes Form Layout Structured Exception Handling Inheritance
  • Agenda
    • An Overview of Visual Basic .NET
    • Developing Windows Applications
    • Upgrade Considerations
    • Upgrade Wizard
  • Developing Windows Apps The New World of Windows Forms
    • Windows Forms as .NET classes
    • Dim frm As New Form1
    • frm.Show() ‘Or frm.ShowDialog()
    • Better Graphics with GDI+
    • Sweeping changes to:
      • Visual Studio .NET
      • Controls and Events
    • Internationalization
  • Developing Windows Apps New RAD features in Visual Studio .NET
    • Property changes reflected directly in the code
    • Non-UI controls placed in separate tray
    • Visual inheritance
    • In-place menu editing
    • Visual tab order editing
    • Anchor, Dock, AutoScroll, Locked properties
    • Resize multiple controls
  • Developing Windows Apps Some new or greatly improved controls
    • LinkLabel, NotifyIcon
    • MainMenu, ContextMenu
    • Provider controls
      • ToolTip
      • ErrorProvider
      • HelpProvider
    • ToolBar
    • Splitter
  • Developing Windows Apps Retired or Replaced Controls
    • Spinner
    • Line and Shape
    • DirListBox, FileListBox, DriveListBox
    • CommonDialog
    • Image
    • Frame
  • Developing Windows Apps Changes to Mouse Events
    • New mouse events:
      • MouseEnter, MouseHover, MouseLeave
      • MouseWheel
    • MouseEventArgs object:
      • Button
      • X, Y
      • Clicks
      • Delta
    • Controls also provide access
  • Developing Windows Apps Working with Drag-and-Drop
    • Between controls same as between applications
    • Concepts are similar to Visual Basic 6
    • No support for automatic drag-and-drop
    • AllowDrop = True
    • All but DragLeave receive DragEventArgs:
      • AllowedEffect
      • Data
      • Effect
      • KeyState
      • X, Y
  • Developing Windows Apps Implementing Drag-and-Drop DoDragDrop() MouseDown DragEnter DragDrop e.Effect e.Data.GetData() Target Control Source Control DragDropResult
  • Demonstration 2 Drag-and-Drop Between TextBox Controls Between TreeView Controls Between PictureBox Controls
  • Agenda
    • An Overview of Visual Basic .NET
    • Developing Windows Applications
    • Upgrade Considerations
    • Upgrade Wizard
  • Upgrade Considerations Upgrade options
    • Don’t upgrade
    • Partial upgrade, use COM interop
    • Complete upgrade
  • Upgrade Considerations Evaluating the Benefits
    • Truly add value?
    • Top 3 reasons to upgrade
      • Increase performance and scalability
      • Take advantage of the .NET Framework
      • New language features and architecture
  • Upgrade Considerations Evaluating the cost
    • Can I use the Upgrade Wizard?
    • Size and Complexity
    • Code quality
  • Upgrade Considerations Evaluating the cost (ctd)
    • Non-upgradeable technologies
    Leave; can work with .NET WebClasses Leave; can work with .NET UserControls Leave Property pages Leave and use COM interop ActiveX ________ Leave; can work with .NET DHTML Applications Upgrade to VB 6 or VB .NET Visual Basic 5 controls Leave OLE Container Control Leave or use alternate inter- application communication Dynamic Data Exchange (DDE) Update to ADO or ADO .NET DAO and RDO data binding Leave or rewrite in GDI+ Visual Basic 6 drawing model Recommendation Technology
  • Prepare for the upgrade Suggested Upgrade Plan
    • Break app into separate projects
    • Determine dependency hierarchy
    • Run it through Upgrade Wizard
    • Determine extent of each upgrade
    • Prepare, upgrade, fix
    • Refactor and retest
  • Agenda
    • An Overview of Visual Basic .NET
    • Developing Windows Applications
    • Upgrade Considerations
    • Upgrade Wizard
  • Using the Upgrade Wizard No Side-by-Side Issues
    • IDEs can be installed on same machine
    • Separate directories
    • Install order is irrelevant
    • Doesn’t affect Microsoft ® ActiveX ®
    • Can run Visual Basic 6 while upgrading
  • Using the Upgrade Wizard Wizard Philosophy
    • It’s your code
      • Should be recognizable
      • Comments preserved
    • Make it viable
      • Enough to get it to run
      • Closest match
      • Microsoft.VisualBasic.Compatibility.Visual Basic6
  • Using the Upgrade Wizard Wizard Methodology
  • Using the Upgrade Wizard Wizard Methodology - NOTES
  • Using the Upgrade Wizard _UpgradeReport.htm
  • Using the Upgrade Wizard EWI Comments
    • Appear In
      • Upgrade Report
      • Code
    • Types
      • UPGRADE_ISSUE
      • UPGRADE_TODO
      • UPGRADE_WARNING
      • Design Issues
      • UPGRADE_NOTE
      • Global Warnings
  • Using the Upgrade Wizard EWI Comments - NOTES
    • Appear In
      • Upgrade Report
      • Code
    • Types
      • UPGRADE_ISSUE
      • UPGRADE_TODO
      • UPGRADE_WARNING
      • Design Issues
      • UPGRADE_NOTE
      • Global Warnings
  • Using the Upgrade Wizard Upgrade Issue Help Files
  • Using the Upgrade Wizard Errors not caught
    • Dim x As New y
    • Some type conversions
    • Passing properties ByRef
    • Dim x() ReDim x(5,5)
    • Some ActiveX control behaviors
  • Demonstration 2 Using the Upgrade Wizard View the Project in the Visual Basic 6 IDE Upgrade the Project Fix build errors Run the Upgraded App
  • Session Summary
    • Visual Basic .NET is not just Visual Basic 6 + 1
    • Use the Upgrade Wizard to Assess Cost
    • Not “all or nothing”
  • For More Information…
    • Preparing Your Visual Basic 6.0 Applications for the Upgrade to Visual Basic .NET
    • http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvb600/html/vb6tovbdotnet.asp
    • Visual Basic .NET: New Programming Model and Language Enhancements Boost Development Power
    • http://msdn.microsoft.com/msdnmag/issues/01/02/vbnet/vbnet.asp
    • Visual Basic Language Changes
    • http://msdn.microsoft.com/vbasic/techinfo/articles/upgrade/transition/language.asp
    Specific articles on the MSDN Web site
  • For More Information…
    • Introduction to Visual Basic .NET for Visual Basic Veterans
    • Upgrading Applications Created in Previous Versions of Visual Basic
    • Visual Basic 6.0 Upgrading Reference
      • Expand Visual Studio .NET > Visual Basic and Visual C# > Reference
    .NET Framework SDK
  • MSDN Essential Resources for Developers Training & Events MSDN Webcasts, MSDN Online Seminars, Tech-Ed, PDC, Developer Days Subscription Services Online Information Membership Programs Print Publications Library, OS, Professional, Enterprise, Universal Delivered via CD-ROM, DVD, Web MSDN Online, MSDN Flash, How-To Resources, Download Center MSDN User Groups MSDN Magazine MSDN News
  • How-To Resources Simple, Step-By-Step Procedures
    • Embedded Development How-to Resources
    • General How-to Resources
    • Integration How-to Resources
    • JScript .NET How-to Resources
    • .NET Development How-to Resources
    • Office Development Resources
    • Security How-to Resources
    • Visual Basic ® .NET How-to Resources
    • Visual C# ™ .NET How-to Resources
    • Visual Studio ® .NET How-to Resources
    • Web Development How-to Resources (ASP, IIS, XML)
    • Web Services How-to Resources
    • Windows Development How-to Resources
    • http://msdn.microsoft.com/howto
  • MSDN Webcasts Interactive, Live Online Event
    • Interactive, Synchronous, Live Online Event
    • Discuss the Hottest Topics from Microsoft
    • Open and Free For The General Public
    • Takes Place Every Tuesdays
    • http://www.microsoft.com/usa/webcasts
  • MSDN Subscriptions THE way to get Visual Studio .NET Visual Studio .NET MSDN Subscriptions NEW
    • Professional
    • Tools to build applications and XML Web services for Windows and the Web
    MSDN Professional $1199 new $899 renewal/upgrade MSDN Enterprise $2199 new $1599 renewal/upgrade MSDN Universal $2799 new $2299 renewal/upgrade
    • Enterprise Developer
    • Enterprise lifecycle tools
    • Team development support
    • Core .NET Enterprise Servers
    • Enterprise Architect
    • Software and data modeling
    • Enterprise templates
    • Architectural guidance
  • Where Can I Get MSDN?
    • Visit MSDN Online at msdn.microsoft.com
    • Register for the MSDN Flash Email Newsletter at
      • msdn.microsoft.com/flash
    • Become an MSDN CD Subscriber at msdn.microsoft.com/subscriptions
    • MSDN online seminars
      • msdn.microsoft.com/training/seminars
    • Attend More MSDN Events
  • MS Press Essential Resources for Developers
    • Upgrading Microsoft Visual Basic 6 to Microsoft Visual Basic .NET
    • Programming Microsoft Visual Basic .NET (Core Reference)
    • Applied Microsoft .NET Framework Programming in Visual Basic .NET
    • Introducing Microsoft .NET, Second Edition
    • Microsoft ADO.NET (Core Reference)
    www.microsoft.com/mspress
  • Become A Microsoft Certified Solution Developer
    • What Is MCSD?
      • Premium certification for professionals who design and develop custom business solutions
    • How Do I attain MCSD Certification?
      • It requires passing four exams to prove competency with Microsoft solution architecture, desktop applications, distributed application development, and development tools
    • Where Do I Get More Information?
      • For more information about certification requirements, exams, and training options, visit www.microsoft.com/mcp
  • Training Training Resources for Developers
    • Course Title:
      • Course Number:
      • Availability:
      • Detailed Syllabus: www.microsoft.com/ traincert
    • Course Title:
      • Course Number:
      • Availability:
      • Detailed Syllabus: www.microsoft.com/ traincert
    To locate a training provider for this course, please access www.microsoft.com/traincert Microsoft Certified Technical Education Centers are Microsoft’s premier partners for training services
  •  
  • Session Credits
    • Author: Sean Campbell
    • Producer/Editor: Field Content Team
    • Reviewers
      • Field Content Council
  • An Overview of Visual Basic .NET Updated language: Key changes (ctd)
    • Single Property declarations:
    • Dim m_sName As String
    • Public Property Name() As String
      • Get
      • Return m_sName
      • End Get
      • Set(ByVal Value As String)
      • m_sName = Value
      • End Set
      • End Property
  • An Overview of Visual Basic .NET Updated language: Key changes (ctd)
    • Block-level scoping
    • Dim IsNum As Boolean = True
    • If IsNum Then
    • Dim i As Int32
    • i = 50
    • End If
    • i = 100 ‘ Compiler error here!
    • File I/O statements only via class libraries
  • Developing Windows Apps The Form Object Hierarchy Object MarshalByRefObject Component Control ScrollableControl ContainerControl Form YourForm
  • Developing Windows Apps The Form Object Hierarchy - NOTES Object MarshalByRefObject Component Control ScrollableControl ContainerControl Form YourForm
  • Developing Windows Apps Visual Basic .NET Controls: Some Changes
    • Control arrays replaced by controls collections
      • Dim btnFoo As New Button
      • pnlBar.Controls.Add(btnFoo)
    • Properties set in InitializeControl()
  • Upgrade Considerations Evaluating the cost (ctd)
    • Other time-consuming upgrade items
      • Games
      • Drag-and-Drop
      • Windows APIs
      • Form.PrintForm
  • Upgrade Considerations Decision making process (ctd) Are there benefits to upgrading? Don’t upgrade No Yes Is it worth the effort? No Develop upgrade plan Yes
  • Prepare for the upgrade Code cleanup suggestions
    • Obsolete language elements
    • DAO/RDO data binding
    • Variants and Variables
    • Constants
      • Screen.MousePointer = adCmdStoredProc
    • Underlying data types
      • Dates as Doubles
    • “ As New” and implicit object creation
  • Prepare for the upgrade Code cleanup suggestions - NOTES
    • Obsolete language elements
    • DAO/RDO data binding
    • Variants and Variables
    • Constants
      • Screen.MousePointer = adCmdStoredProc
    • Underlying data types
      • Dates as Doubles
    • “ As New” and implicit object creation
  • Using the Upgrade Wizard Starting the upgrade
    • Break Project Group into Projects
    • Open a valid Visual Basic 6 Project in Visual Studio .NET
    • Select a Project Type (EXE or DLL)
    • Select a Location
    • Click Finish
    • View the upgrade report