Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The button is initially located at the far left and diagonally oriented towards the bottom right until it reaches the lower edge and then rebounds in the same direction and so on ..

What I have tried:

You try to work on a timer so that an event is triggered when the button reaches the edge and the button movement is reversed by the selected destination
Posted
Updated 29-Nov-17 10:17am
Comments
cvogt61457 29-Nov-17 16:13pm    
Hmmm....
Not sure what you tried.
This looks like school homework.
Please read the FAQ
You will need to show the work that you have tried and explain what doesn't work.
When you get it to compile successfully, run within the debugger to watch what happens or doesn't happen.
Good luck !!!

1 solution

The timer would do the trick. In the timer event handler update the button position based on current speed and position. On reaching the bottom-right position, invert the button speed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900