with end with
他是一种结构
举例
.....
with cmdResize
.caption="确定"
.top=1000
.left=200
end with
.....
相当于
.....
cmdResize .caption="确定"
cmdResize .top=1000
cmdResize .left=200
....
他是一种结构
举例
.....
with cmdResize
.caption="确定"
.top=1000
.left=200
end with
.....
相当于
.....
cmdResize .caption="确定"
cmdResize .top=1000
cmdResize .left=200
....
With cmdResize
If X > 0 And X < 100 Then
NewPointer = vbSizeWE
ElseIf X > .Width - 100 And X < .Width Then
NewPointer = vbSizeWE
Else
NewPointer = vbDefault
End If
If NewPointer <> .MousePointer Then
.MousePointer = NewPointer
End If
End With
中 .Width 和 .MousePointer 就相当于cmdResize.Width,cmdResize.MousePointer
.后面的是对象的各属性end with代码可以少写好多你以上的代码也可以不用WITH
可以直接在.前面加上cmdResize就可以了