- 最後登錄
- 2023-5-11
- 在線時間
- 2 小時
- 註冊時間
- 2007-8-9
- 閱讀權限
- 20
- 精華
- 0
- UID
- 2045368
- 帖子
- 38
- 積分
- 196 點
- 潛水值
- 10894 米
| 若對尊貴或贊助會員有任何疑問,歡迎向我們查詢。我們的即時通或MSN: admin@eyny.com 本帖最後由 arthurliuliu 於 2011-8-24 07:51 AM 編輯
- Dim x1, y1, xx, kk
- Private Sub Form_Load()
- kk = 0
- End Sub
- Private Sub pick_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- x1 = X: y1 = Y
- End Sub
- Private Sub pick_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- If Button = 1 Then
- delta_x = X - x1
- delta_y = Y - y1
- pick.Move pick.Left + delta_x, pick.Top + delta_y
-
- If pick.Left + delta_x > 0 Or pick.Left + delta_x <= -3240 Then
- If (pick.Left > 0) Then
- pick.Left = -1
- End If
- If (pick.Left < -3240) Then
- pick.Left = -3239
- End If
- End If
- If pick.Top + delta_y > 0 Or pick.Top + delta_y <= -3360 Then
- If (pick.Top > 0) Then
- pick.Top = 1
- End If
- If (pick.Top < -3360) Then
- pick.Top = -3359
- End If
- End If
- End If
- End Sub
複製代碼
我是用2個PictureBox做成的 先在桌面上放置一個PictureBox 然後在裡面放置PictureBox稱為pick
在pick 上放置圖片 在程式中可以固定邊界 執行時 圖片可以托移然後托至到程式中設定的邊界時 會停止
但是這時就會發生一個問題 就是當圖片再托移時 會有殘影 請求各位VB高手 小弟為這問題卡很久了>"<... |
|