Page 24 - eFC10810_程式語言與設計(下)_課本PDF
P. 24

表單設計


                                 PictureBox1






               5

             重複結構
















               6           PictureBox3     PictureBox2 PictureBox4
               陣列
                              解碼動態

                           Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

                               Dim i As Integer
                                                          改變圖片由小逐漸變大
                               For i = 30 To 100
                                                                                          移動圖片到新座標位置
                                   PictureBox1.Location = New Point(100, 150)

                                   PictureBox1.Size = New Size(i, i)                       改變圖片大小
               7               Next i

               函式
             與副程式
                               PictureBox2.Visible = False                    隱藏企鵝圖片
                               MsgBox("I got you!!")

                               For i = 100 To 30 Step -1                   改變圖片由大逐漸變小

                                   PictureBox1.Location = New Point(10, 10)
                                   PictureBox1.Size = New Size(i, i)

                               Next i

               8           End Sub
             綜合應用





              14






          '$      $)   JOEE
   19   20   21   22   23   24   25   26   27   28   29