我爱Aspx >> VB.Net >> Chapter 3 Major VB.NET Changes(2)Chapter 3 Major VB.NET Changes(2)
txtBillTo as TextBox
Dim txtShipTo as TextBox
txtShipTo =txtBillTo
The line of code txtShipTo =txtBillTo sets the Text property of txtShipTo to the
value in the Text property of txtBillTo . But what if that isn’t what you wanted?
What if, instead, you wanted to create an object reference in txtShipTo that referred
to the object txtBillTo ? You’d have to use this code:
Set txtShipTo =txtBillTo
As you can see, default properties require you to use the Set keyword to set refer-ences
from one object variable to another.
VB.NET gets around this problem by getting rid of default properties. Therefore, to
copy the Text property from txtBillTo into the Text property of txtShipTo ,you’d
have to use this code:
txtShipTo.Text =txtBillTo.Text
Setting the two variables equal to each other sets a reference from one to the other. In
【我对这篇文章有话说?】
Chapter 3 Major VB.NET Changes..[05-20]
Chapter 2 Your First VB.NET(2)[05-20]
Chapter 2 Your First VB.NET(1)[05-20]
VB.NET 的新特点:变量,类型,数..[05-20]
VB.NET Samples(送给Blood等VB拥..[05-20]
HOW TO: Compute and Compare Ha..[05-20]
为什么选择VB.NET?(转贴)[05-20]
从VB6到VB.NET的变化综述 (转)[05-20]
vb.Net编程简介之一(轉)[05-20]
vb.Net编程简介之二(轉)[05-20]
Chapter 3 Major VB.NET Changes..[05-20]
Chapter 2 Your First VB.NET(2)[05-20]
Chapter 2 Your First VB.NET(1)[05-20]
VB.NET 的新特点:变量,类型,数..[05-20]
VB.NET Samples(送给Blood等VB拥..[05-20]
HOW TO: Compute and Compare Ha..[05-20]
为什么选择VB.NET?(转贴)[05-20]
从VB6到VB.NET的变化综述 (转)[05-20]
vb.Net编程简介之一(轉)[05-20]
vb.Net编程简介之二(轉)[05-20]