简体   繁体   中英

How to make it so my picturebox[that can move] overlap the picturebox it should move over?

and today I was testing my game, and wondering how to make it so when you move over a ladder (you control the picturebox1 with arrows keys, and the ladder is picturebox2) the player moves over the ladder, like, when you move on the bounds of the ladder, you go "under" the ladder and I want to make it so that you go "over" the ladder. Here is a picture of going under the ladder: 表格图片

Is this even possible? Also, i am looking to do this within the code, thanks for your time! Note: The player is the red cube

Very Simple. try this

PictureBox Ladder = new PictureBox();
...setting the picture and it's location...
PictureBox Player = new PictureBox();
...setting the picture and it's location...
Ladder.SendToBack();
or...
Player.BringToFront();

The player control will be drawn before the ladder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM