Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

I am trying to create a program with a movable button that stays inside the boundaries of a group box. What I am trying to do is have the button move in a direction until it hits the group box border, then the button will move in the opposite direction. So far, I can get the button to move to the border and stop, but I can't figure out how to move it back in the opposite direction. With the IF statements I am using, the button will just move back and forth by one pixel after it reaches the corner of the group box.

 

I feel I am overlooking something obvious. Any insight would be appreciated.

 

Thanks!

Posted
You could just have a boolean flag called movingRight, and then use that to determine how to move your button. Why don't you post what you have so far, and maybe someone will be able to help you.

"It may be roundly asserted that human ingenuity cannot concoct a cipher which human ingenuity cannot resolve."

 

- Edgar Allan Poe, 1841

 

I long to accomplish great and noble tasks, but it is my chief duty to accomplish humble tasks as though they were great and noble. The world is moved along, not only by the mighty shoves of its heroes, but also by the aggregate of the tiny pushes of each honest worker.

 

- Helen Keller

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...