線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1686
推到 Plurk!
推到 Facebook!

請問圖片要如何向下移動??

尚未結案
kennan8176
一般會員


發表:8
回覆:9
積分:3
註冊:2005-04-11

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-06-02 16:59:11 IP:220.130.xxx.xxx 未訂閱
以下是圖片動作是按Botton向左移動20pixel 但是我想改成向下移動..可是都改不成功.. 請問高手們要如何改呢??? 以下是圖片動作是按Botton向左移動20pixel 但是我想改成向下移動..可是都改不成功.. 請問高手們要如何改呢??? Dim n, i As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If picRunner.Location.X > -(picRunner.Width) Then picRunner.Location = New Point(picRunner.Location.X - 20, 130) Else picRunner.Location = New Point(Me.Width, 130) End If i = 1 '要記得累加 End Sub Private Sub Form4_1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load pic4.Visible = False picRunner.Location = New Point(Me.Width, 130) picRunner.Image = pic4.Image n = n 1 End Sub 發表人 - kennan8176 於 2005/06/02 17:08:59
kartan_01
一般會員


發表:42
回覆:60
積分:20
註冊:2004-12-08

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-06-02 17:23:38 IP:61.221.xxx.xxx 未訂閱
Dim n, i As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If picRunner.Location.X > -(picRunner.Width) Then //picRunner.Location.Y > -(picRunner.Height) picRunner.Location = New Point(picRunner.Location.X - 20, 130) //New Point(130 , picRunner.Location.Y - 20) Else picRunner.Location = New Point(Me.Width, 130) //picRunner.Location = New Point(130,Me.Height) End If i = 1 '要記得累加 End Sub Private Sub Form4_1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load pic4.Visible = False picRunner.Location = New Point(Me.Width, 130) //picRunner.Location = New Point(130,Me.Height) picRunner.Image = pic4.Image n = n 1 End Sub
kennan8176
一般會員


發表:8
回覆:9
積分:3
註冊:2005-04-11

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-06-03 01:47:07 IP:220.134.xxx.xxx 未訂閱
這樣結果是往上移動說... 怎麼調整都無法往下移動內......怎麼會這樣哪裡出錯了呢???    
引言: Dim n, i As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If picRunner.Location.X > -(picRunner.Width) Then //picRunner.Location.Y > -(picRunner.Height) picRunner.Location = New Point(picRunner.Location.X - 20, 130) //New Point(130 , picRunner.Location.Y - 20) Else picRunner.Location = New Point(Me.Width, 130) //picRunner.Location = New Point(130,Me.Height) End If i = 1 '要記得累加 End Sub Private Sub Form4_1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load pic4.Visible = False picRunner.Location = New Point(Me.Width, 130) //picRunner.Location = New Point(130,Me.Height) picRunner.Image = pic4.Image n = n 1 End Sub
kartan_01
一般會員


發表:42
回覆:60
積分:20
註冊:2004-12-08

發送簡訊給我
#4 引用回覆 回覆 發表時間:2005-06-03 07:59:26 IP:61.221.xxx.xxx 未訂閱
如果-是往上移動...改成 試試
kennan8176
一般會員


發表:8
回覆:9
積分:3
註冊:2005-04-11

發送簡訊給我
#5 引用回覆 回覆 發表時間:2005-06-03 08:21:10 IP:220.130.xxx.xxx 未訂閱
我是說~你所寫出來的結果是往上移動.... 我想要的結果是往下移動.... 至於改成+我改過唷...會變成不能動= =...按理說應該可以才對 不知是哪還要更改的....    
引言: 如果-是往上移動...改成 試試
sham1980
一般會員


發表:17
回覆:14
積分:6
註冊:2005-05-10

發送簡訊給我
#6 引用回覆 回覆 發表時間:2005-06-03 11:54:45 IP:210.65.xxx.xxx 未訂閱
'我並未做碰到底則停止的判斷,不過這應該是不難吧,你再試試吧,祝順心。 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click '向左移動 If picRunner.Location.X > -(picRunner.Width) Then picRunner.Location = New Point(picRunner.Location.X - 20, 130) Else picRunner.Location = New Point(Me.Width, 130) End If End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click '向右 If picRunner.Location.X > -(picRunner.Width) Then picRunner.Location = New Point(picRunner.Location.X 20, 130) Else picRunner.Location = New Point(Me.Width, 130) End If End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click '向上 If picRunner.Location.X > -(picRunner.Width) Then picRunner.Location = New Point(picRunner.Location.X, picRunner.Location.Y - 20) Else picRunner.Location = New Point(Me.Width, 130) End If End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click '向下 If picRunner.Location.X > -(picRunner.Width) Then picRunner.Location = New Point(picRunner.Location.X, picRunner.Location.Y 20) Else picRunner.Location = New Point(Me.Width, 130) End If End Sub
sham1980
一般會員


發表:17
回覆:14
積分:6
註冊:2005-05-10

發送簡訊給我
#7 引用回覆 回覆 發表時間:2005-06-03 12:01:24 IP:210.65.xxx.xxx 未訂閱
不是只要這一行就可以了嗎?不知道你其他的判斷是要做什麼的?可以跟我說嗎? picRunner.Location = New Point(picRunner.Location.X, picRunner.Location.Y 20)
kennan8176
一般會員


發表:8
回覆:9
積分:3
註冊:2005-04-11

發送簡訊給我
#8 引用回覆 回覆 發表時間:2005-06-03 13:16:18 IP:220.130.xxx.xxx 未訂閱
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click '向下 If picRunner.Location.X > -(picRunner.Width) Then picRunner.Location = New Point(picRunner.Location.X, picRunner.Location.Y + 20) Else picRunner.Location = New Point(Me.Width, 130) '是判斷碰到牆壁時回到起始 End If End Sub 是為了案著Botton時候可以循環移動        
引言: 不是只要這一行就可以了嗎?不知道你其他的判斷是要做什麼的?可以跟我說嗎? picRunner.Location = New Point(picRunner.Location.X, picRunner.Location.Y 20)
sham1980
一般會員


發表:17
回覆:14
積分:6
註冊:2005-05-10

發送簡訊給我
#9 引用回覆 回覆 發表時間:2005-06-03 15:03:10 IP:210.65.xxx.xxx 未訂閱
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click '向左移動,碰底到從右邊從新 If picRunner.Location.X > 0 Then picRunner.Location = New Point(picRunner.Location.X - 20, picRunner.Location.Y) Else picRunner.Location = New Point(Me.Width, picRunner.Location.Y) End If End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click '向右,碰底到從左邊從新 If picRunner.Location.X < Me.Width Then picRunner.Location = New Point(picRunner.Location.X 20, picRunner.Location.Y) Else picRunner.Location = New Point(0, picRunner.Location.Y) End If End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click '向上,碰底到從下面從新 If picRunner.Location.Y > 0 Then picRunner.Location = New Point(picRunner.Location.X, picRunner.Location.Y - 20) Else picRunner.Location = New Point(picRunner.Location.X, Me.Height) End If End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click '向下,碰底到從上面從新 If picRunner.Location.Y < Me.Height Then picRunner.Location = New Point(picRunner.Location.X, picRunner.Location.Y 20) Else picRunner.Location = New Point(picRunner.Location.X, 0) End If End Sub
kennan8176
一般會員


發表:8
回覆:9
積分:3
註冊:2005-04-11

發送簡訊給我
#10 引用回覆 回覆 發表時間:2005-06-03 16:16:10 IP:220.130.xxx.xxx 未訂閱
太感謝了...我剛才找出為啥..就是不能向下移動 因為初始值我設定在底端難怪看不到向下移動的畫面= =" 感謝大大唷~非常完整....    
引言: Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click '向左移動,碰底到從右邊從新 If picRunner.Location.X > 0 Then picRunner.Location = New Point(picRunner.Location.X - 20, picRunner.Location.Y) Else picRunner.Location = New Point(Me.Width, picRunner.Location.Y) End If End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click '向右,碰底到從左邊從新 If picRunner.Location.X < Me.Width Then picRunner.Location = New Point(picRunner.Location.X 20, picRunner.Location.Y) Else picRunner.Location = New Point(0, picRunner.Location.Y) End If End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click '向上,碰底到從下面從新 If picRunner.Location.Y > 0 Then picRunner.Location = New Point(picRunner.Location.X, picRunner.Location.Y - 20) Else picRunner.Location = New Point(picRunner.Location.X, Me.Height) End If End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click '向下,碰底到從上面從新 If picRunner.Location.Y < Me.Height Then picRunner.Location = New Point(picRunner.Location.X, picRunner.Location.Y 20) Else picRunner.Location = New Point(picRunner.Location.X, 0) End If End Sub
系統時間:2024-05-21 21:30:58
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!