Chapter 3 Major VB.NET Changes(1)
点击次数:22 次 发布日期:2008-11-06 08:07:08 作者:源代码网
|
源代码网推荐 VB.NET introduces major changes to the VB language. Some 源代码网推荐 are modifications to existing ways of working, whereas others 源代码网推荐 are brand new. This chapter will cover some of those 源代码网推荐 changes, but this is by no means an exhaustive list of all 源代码网推荐 changes from VB to VB.NET. First, you’ll see some of the 源代码网推荐 features that have changed. Then you will see some of the 源代码网推荐 new features. 源代码网推荐 General Changes 源代码网推荐 There are a number of general changes to be aware of when 源代码网推荐 moving from VB to VB.NET. Among them are topics such as 源代码网推荐 the removal of default properties, subs and functions requir-ing 源代码网推荐 parentheses, ByVal being the default method for passing 源代码网推荐 parameters, and changes to the logical operators. These 源代码网推荐 changes, and others, are detailed in this section. 源代码网推荐 Default Properties 源代码网推荐 In VB6, objects could have default properties. For example, 源代码网推荐 the following code is perfectly valid in VB6, if you assume 源代码网推荐 that Text1 is a text box: 源代码网推荐 Text1=”Hello,World ” 源代码网推荐 This code takes the string “Hello,World ”and sets the 源代码网推荐 default property of the text box, the Text property, to the 源代码网推荐 string. The major drawback to default properties is that they 源代码网推荐 require you to have a Set command in VB. For example, take 源代码网推荐 a look at the following block of VB6 code: 源代码网推荐 CHAPTER 3 源代码网推荐 Major VB.NET Changes 源代码网推荐 源代码网供稿. |
