我要在picturebox中随机的画两行或一行text框,怎么办????

解决方案 »

  1.   

    如果只有一两行,可以不用控件数组。使用随机数来控制两个文本控件的visible,再使用随机函数确定各个文本框的top 和left(当然如果某一个text.visible=false,此时可以不管这个text的top和left.
    dim A as integer
    dim B as integer
    A =1+int(100*rnd())
    B =1+int(100*rnd())if A<=50 then
       textA.visible =false
    else
       textA.visible=true
       textA.top = picture.height *rnd()
       textA.left = picture.width *rnd()
    end ifif B<=50 then
       textA.visible =false
    else
       textB.visible=true
       textB.top = picture.height *rnd()
       textB.left = picture.width *rnd()
    end if