• Save
Moving to Microsoft Visual Basic .NET
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Moving to Microsoft Visual Basic .NET

  • 12,471 views
Uploaded on

Moving to Microsoft Visual Basic .NET

Moving to Microsoft Visual Basic .NET

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
12,471
On Slideshare
12,416
From Embeds
55
Number of Embeds
8

Actions

Shares
Downloads
0
Comments
1
Likes
6

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

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • 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:

Transcript

  • 1. Moving to Microsoft ® Visual Basic ® .NET Patrick McGowen Developer Evangelist Microsoft ® Corporation
  • 2. What we will cover
    • Microsoft ® Visual Basic ® .NET
    • Windows Forms
    • Upgrading from Visual Basic 6
  • 3. Session Prerequisites
    • Experience with Visual Basic
    • Experience building Microsoft ® Windows ® applications
    Level 200
  • 4. Why Do This Presentation?
    • .NET changes everything
    • Upgrading is an involved process
  • 5. Demonstrations
    • Overview of Key Visual Basic .NET Changes
    • Using the Upgrade Wizard
  • 6. Demonstrations
    • Overview of Key Visual Basic .NET Changes
    • Implementing Drag-and-Drop Operations
    • Using the Upgrade Wizard
  • 7. Agenda
    • An Overview of Visual Basic .NET
    • Developing Windows Applications
    • Upgrade Considerations
    • Upgrade Wizard
  • 8. 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
  • 9. 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
  • 10. 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.
  • 11. 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
  • 12. 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
  • 13. 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
  • 14. 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
  • 15.
    • 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
  • 16. Demonstration 1 Key Visual Basic .NET Changes Form Layout Structured Exception Handling Inheritance
  • 17. Agenda
    • An Overview of Visual Basic .NET
    • Developing Windows Applications
    • Upgrade Considerations
    • Upgrade Wizard
  • 18. 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
  • 19. 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
  • 20. Developing Windows Apps Some new or greatly improved controls
    • LinkLabel, NotifyIcon
    • MainMenu, ContextMenu
    • Provider controls
      • ToolTip
      • ErrorProvider
      • HelpProvider
    • ToolBar
    • Splitter
  • 21. Developing Windows Apps Retired or Replaced Controls
    • Spinner
    • Line and Shape
    • DirListBox, FileListBox, DriveListBox
    • CommonDialog
    • Image
    • Frame
  • 22. 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
  • 23. 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
  • 24. Developing Windows Apps Implementing Drag-and-Drop DoDragDrop() MouseDown DragEnter DragDrop e.Effect e.Data.GetData() Target Control Source Control DragDropResult
  • 25. Demonstration 2 Drag-and-Drop Between TextBox Controls Between TreeView Controls Between PictureBox Controls
  • 26. Agenda
    • An Overview of Visual Basic .NET
    • Developing Windows Applications
    • Upgrade Considerations
    • Upgrade Wizard
  • 27. Upgrade Considerations Upgrade options
    • Don’t upgrade
    • Partial upgrade, use COM interop
    • Complete upgrade
  • 28. 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
  • 29. Upgrade Considerations Evaluating the cost
    • Can I use the Upgrade Wizard?
    • Size and Complexity
    • Code quality
  • 30. 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
  • 31. 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
  • 32. Agenda
    • An Overview of Visual Basic .NET
    • Developing Windows Applications
    • Upgrade Considerations
    • Upgrade Wizard
  • 33. 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
  • 34. 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
  • 35. Using the Upgrade Wizard Wizard Methodology
  • 36. Using the Upgrade Wizard Wizard Methodology - NOTES
  • 37. Using the Upgrade Wizard _UpgradeReport.htm
  • 38. Using the Upgrade Wizard EWI Comments
    • Appear In
      • Upgrade Report
      • Code
    • Types
      • UPGRADE_ISSUE
      • UPGRADE_TODO
      • UPGRADE_WARNING
      • Design Issues
      • UPGRADE_NOTE
      • Global Warnings
  • 39. 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
  • 40. Using the Upgrade Wizard Upgrade Issue Help Files
  • 41. 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
  • 42. 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
  • 43. Session Summary
    • Visual Basic .NET is not just Visual Basic 6 + 1
    • Use the Upgrade Wizard to Assess Cost
    • Not “all or nothing”
  • 44. 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
  • 45. 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
  • 46. 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
  • 47. 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
  • 48. 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
  • 49. 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
  • 50. 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
  • 51. 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
  • 52. 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
  • 53. 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
  • 54.  
  • 55. Session Credits
    • Author: Sean Campbell
    • Producer/Editor: Field Content Team
    • Reviewers
      • Field Content Council
  • 56. 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
  • 57. 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
  • 58. Developing Windows Apps The Form Object Hierarchy Object MarshalByRefObject Component Control ScrollableControl ContainerControl Form YourForm
  • 59. Developing Windows Apps The Form Object Hierarchy - NOTES Object MarshalByRefObject Component Control ScrollableControl ContainerControl Form YourForm
  • 60. 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()
  • 61. Upgrade Considerations Evaluating the cost (ctd)
    • Other time-consuming upgrade items
      • Games
      • Drag-and-Drop
      • Windows APIs
      • Form.PrintForm
  • 62. 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
  • 63. 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
  • 64. 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
  • 65. 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