![5e1767ad6c90014b69ec4e2a9418d9bd.png](https://img-blog.csdnimg.cn/img_convert/5e1767ad6c90014b69ec4e2a9418d9bd.png)
(接上讲)
2 属性的赋值和读取
Public Property Get A() As Integer '读
A = MyA
End Property
Public Property Let A(A As Integer) '写
MyA = A
End Property
Public Property Get B() As Integer
B = MyB
End Property
Public Property Let B(B As Integer)
MyB = B
End Property
Public Property Get C() As Integer
C = MyC
End Property
Public Property Let C(C As Integer)
MyC = C
End Property
上面代码的意义相信大家十分地清楚了,不再过多地讲解,只是提醒大家一下,利用变量宿主在对属性设置的时候,这种写法可以作为一个规范的写法去应用。LET或者SET是属性的写入,GET是属性的读取,所谓的写入是将外部的数据写入宿主之中,而读取是将数据从宿主中提取出来。关于属性的设置一共是两种方案