永发信息网

把VB这段代码简写

答案:3  悬赏:0  手机版
解决时间 2021-07-18 17:19
  • 提问者网友:送舟行
  • 2021-07-17 22:17
Shape1(0).Width = "500"
Shape1(1).Width = "500"
Shape1(2).Width = "500"
Shape1(3).Width = "500"
Shape1(4).Width = "500"
Shape1(1).Height = "500"
Shape1(2).Height = "500"
Shape1(3).Height = "500"
Shape1(4).Height = "500"
最佳答案
  • 五星知识达人网友:怙棘
  • 2021-07-17 22:44

Private Sub Command1_Click()
Dim i As Long


For i = 0 To 4
Shape1(i).Width = "500"
Shape1(i).Height = "500"
Next
End Sub

全部回答
  • 1楼网友:掌灯师
  • 2021-07-17 23:57

Dim i As Integer For i = 0 To 4 With Shape1(i) .Width = "500" .Height = "500" End With Next i

  • 2楼网友:逐風
  • 2021-07-17 23:08

用循环吧.. for(int i;i<4;i++)

{

Shape1(i).Width = "500"

Shape1(i).Height = "500"

}

忘了vb的循环格式是不是这样写了...

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯