Comprehensive analysis of vb.net (1)

Source: Internet
Author: User
Tags include new features resource
Objective
The next version of Visual Basic, Visual Basic.NET, will be officially released in the 4th quarter of 2001. The new version of the Visual Basic.NET has a lot of VB developers can only dream of the latest features and new features. At the same time, growth and development also means paying a price, there are many things in the new Visual Basic.NET that need to be learned again, and some subtle changes are likely to cause unexpected problems.

Microsoft. NET platform contains a wide range of content. This article will go to the vb.net and make a panoramic introduction to it to see what it is, what it is and how to use it. In particular, this article will analyze the changes in the VB.net integrated development environment, object-oriented functions, changes in the underlying system, numerous syntactic improvements, and enhancements to application deployment and encapsulation support.

I. Integrated development environment

The first time you start vb.net, the first thing you notice is not the excellent object-oriented support of Visual Basic, but rather its IDE (integrated development environment, integrated Development environment). Vs. NET IDE gives people a sense of familiarity, because the IDE's working group designed the Ide,vs.net IDE's improvements in VB before designing the VB IDE experience.

Figure A: Click to enlarge

Improvements to the IDE do not remain on the surface. All. NET language is very comprehensive and powerful with the new tools available within the same ide,ide. For example, all design windows can be automatically hidden (just like the Windows taskbar), thereby dramatically reducing the sense of confusion.

When you start vb.net, the VS home Page is the first interface we see. The home page shows the recently modified project and offers the option to open an existing project and create a new project (as shown in Figure a). All of these options are displayed in HTML link form. Note that this is not a simulated effect, and the layout of the home page is actually written by DHTML. For this reason, users can customize the home page to display other options, information, and HTML links that are useful to them.

The New Project dialog box provides options for creating projects in any one language, as shown in Figure B, noting that several languages are listed in the left tree list in the diagram. If a third-party language that supports vs.net is already installed on your system, Microsoft may also include these languages in this list.

Figure B: Click to enlarge

In Figure B, the VB node in the tree list is open, and some icons on the right show several options for creating a new project. Note that there are some new options, such as Web Service, Web Control Library, Class library. The last option shows that in vb.net, multiple related classes can be merged into a single module file instead of putting each class into one file as VB6.

The IDE that activates the WinForms project is most similar to the traditional VB IDE. Figure C shows the main differences between the two.

Figure C: Click to enlarge

▲ Hide the tool box. By default, the tool box is mostly hidden, and clicking its title pulls it out (Figure D shows an extended tool box). If necessary, you can set the tool box so that it always appears on the screen. For VB developers, the biggest change here is that the controls in the tool box are now vertically arranged, each with a textual description, rather than just an icon like VB6.

Figure D: Click to enlarge

▲ Tabbed Windows (Tabbed child window). Vs. NET replaces the original MDI child window layout with a tabbed child window layout located above the screen. Cards include: Home Page, Form Layout window, Code window, help screen.

▲ Task List. The task list is an important improvement that helps developers keep track of all the tasks to be done. Code generators and compilers automatically add something to the task list. Manually adding a task item can be done as follows: Find the place in your code that needs to be modified, and then insert a line with a comment that starts with "TODO:" and the task will automatically appear in the task list thereafter. Clicking on a task in the Tasks list shows where the task will be completed in the Code Editor. This quick definition of tasks and the mechanism to return tasks will greatly improve development efficiency.

▲ Program Explorer (Solution Explore). It replaces the original Engineering Explorer (Project Explorer) and is very similar to the Resource manager in Visual InterDev. Like the resource manager in InterDev, Solution Explorer shows the various resources used in the project, including code modules written in other languages, and a variety of non-code resources. References is an entirely new form of resource in Solution Explorer, references manages namespaces, similar to the component references in VB6.

▲ property box (properties). The Properties box is very similar to the property box in VB6, but it now supports more layout methods (display mode).

▲ the form Layout tool strip (Form Layout). In VB6, the task of arranging controls on a form is accomplished by a toolbar named "Form Editor." The improved new sidebar provides more functionality and is opened by default in WinForms type projects.

Figure E: Click to enlarge

In addition to the above six improvements, VB. NET's code Editor also has an important new feature: In the Code editing window, click the plus or minus sign on the left side of the line to expand or collapse the code block, as shown in Figure E. This feature was originally designed to hide code generated automatically by the visual designer, but it can also be used to hide code that is not relevant to the current task.

The design environment for WEB forms engineering is also slightly different from the original VB6 design environment, as shown in Figure F. Only two cards are displayed below the form Layout window, respectively, design and HTML. The functions of these two cards are similar to those of the same location in Visual InterDev. The design window is used to edit the appearance of the form, and the HTML window is used to view the DHTML code.

Figure F: Click to enlarge

Vb. NET another noticeable change is its form engine. Microsoft has abandoned the original form engine, and now it provides us with the Windows Forms forms engine. All CLR-based languages use the Windows Forms engine, and Windows Forms has many outstanding advantages over the form engine of VB 6. For example, Windows forms supports creating forms that automatically change the size of a component, allowing you to anchor controls to a specific location on a form. In other words, there is no need for third-party tools to accomplish these special tasks. Windows forms also has some interesting techniques, such as creating transparent forms.

Previously, VB hides all the details of the form's construction process. We design the form in the IDE and add the code to the Initialize event, but there is no control over the process between the two. The form is now a class that contains all the code that constructs the form. Most programmers will not look at this code that describes the details of the window's construction, and if there is some sort of operation that is bound to break the application, the operation is messing with the code here. On the other hand, because the code allows users to drill down on the behind-the-scenes details of the vb.net construction form, experienced users can use the code to implement a variety of advanced features. If you don't want to see the code, you can't look at it because the new code editor has the ability to expand and collapse the code area, and the code that describes the details of the form's construction process is collapsed by default. The Code Editor also has some new practical features, such as automatic indentation, built-in line number display, and so on.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.