rectangle a=new a() { width=1; height=2; }
我曾经构建过像这样的对象,在visual basic中有类似的方法吗? 对不起,我无法真正标记这项技术。
答案 0 :(得分:6)
Dim a = New Rectangle With { .width = 1, .height = 2 }
答案 1 :(得分:-1)
Rectangle
有constructor来定义宽度和高度:
Dim r As New Rectangle(1, 1, 200, 300) 'x,y,width,height