Click here to Skip to main content
15,913,487 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: ListView Pin
yesu prakash15-Dec-07 16:28
yesu prakash15-Dec-07 16:28 
GeneralRe: ListView Pin
Paul Conrad15-Dec-07 9:10
professionalPaul Conrad15-Dec-07 9:10 
GeneralRe: ListView Pin
yesu prakash15-Dec-07 16:28
yesu prakash15-Dec-07 16:28 
GeneralRe: ListView Pin
Paul Conrad16-Dec-07 1:58
professionalPaul Conrad16-Dec-07 1:58 
GeneralRe: ListView Pin
yesu prakash16-Dec-07 2:25
yesu prakash16-Dec-07 2:25 
GeneralRe: ListView Pin
Paul Conrad23-Dec-07 14:06
professionalPaul Conrad23-Dec-07 14:06 
Questionpong video game Pin
Cedrickdeorange15-Dec-07 2:48
Cedrickdeorange15-Dec-07 2:48 
AnswerRe: pong video game Pin
Matthew Butler15-Dec-07 3:16
Matthew Butler15-Dec-07 3:16 
I'm assuming from the code you have given that the ball can only move by a cirtain amount each time (5pix up/down and 5pix left/right)... this might not be enough.

What you need to do is calculate both the horizontal and vertical distances to the wall and then divide them by the number of ticks you want the ball to move until it reaches the wall: this is the amount you need to move the ball each timer tick...

If the distance to the left wall is 100 pixels (for example) and the distance you want the ball to travel downwards is 40 pixels (giving the target position of (0, 40)) then the ball will need to move 100/N to the left and 40/N downwards each timer tick, where N is the number of ticks you want the ball to move until it reaches the wall.

I believe this would work: it requires the ball's vertical/horizontal speed to be something other than 5 pixels per tick though.

Essentially you need to use relative positioning rather than absolute positioning.
(Small edit at 3:45).

Hope this helps.
Matthew Butler

modified on Saturday, December 15, 2007 10:42:33 AM

QuestionPowerpoint sound problem (vb.net) Pin
sbkk14-Dec-07 22:16
sbkk14-Dec-07 22:16 
GeneralPowerpoint sound problem Pin
sbkk14-Dec-07 22:14
sbkk14-Dec-07 22:14 
GeneralRe: Powerpoint sound problem Pin
Dave Kreskowiak15-Dec-07 5:18
mveDave Kreskowiak15-Dec-07 5:18 
GeneralGet table names from database. Pin
Cory Kimble14-Dec-07 10:19
Cory Kimble14-Dec-07 10:19 
GeneralRe: Get table names from database. Pin
Christian Graus14-Dec-07 12:14
protectorChristian Graus14-Dec-07 12:14 
GeneralRe: Get table names from database. Pin
pmarfleet14-Dec-07 12:19
pmarfleet14-Dec-07 12:19 
GeneralRe: Get table names from database. Pin
Cory Kimble18-Dec-07 5:52
Cory Kimble18-Dec-07 5:52 
GeneralRe: Get table names from database. Pin
pmarfleet18-Dec-07 6:25
pmarfleet18-Dec-07 6:25 
GeneralSystem.Timers.ElapsedEventArgs Pin
Raveheart14-Dec-07 6:36
Raveheart14-Dec-07 6:36 
GeneralRe: System.Timers.ElapsedEventArgs Pin
Christian Graus14-Dec-07 9:59
protectorChristian Graus14-Dec-07 9:59 
GeneralRe: System.Timers.ElapsedEventArgs Pin
Raveheart14-Dec-07 12:38
Raveheart14-Dec-07 12:38 
GeneralRe: System.Timers.ElapsedEventArgs Pin
Luc Pattyn14-Dec-07 13:33
sitebuilderLuc Pattyn14-Dec-07 13:33 
GeneralRe: System.Timers.ElapsedEventArgs Pin
Raveheart18-Dec-07 8:29
Raveheart18-Dec-07 8:29 
GeneralRe: System.Timers.ElapsedEventArgs Pin
Christian Graus14-Dec-07 15:37
protectorChristian Graus14-Dec-07 15:37 
GeneralRe: System.Timers.ElapsedEventArgs Pin
Raveheart17-Dec-07 4:30
Raveheart17-Dec-07 4:30 
GeneralWindows platform SDK Pin
plural14-Dec-07 2:25
plural14-Dec-07 2:25 
GeneralRe: Windows platform SDK Pin
Dave Kreskowiak14-Dec-07 3:57
mveDave Kreskowiak14-Dec-07 3:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.