Home » Category » Microsoft Visual Basic

Microsoft Visual Basic: ZOrder

104| Mon, 03 Dec 2007 15:08:00 GMT| theboy| Comments (6)
Can anyone tell me if using the ZOrder property will work for the following, as I cant seem to egt it to. I have a verticle line that has its autoredraw propety set to true. When i click on the line a circle is drawn at the top of the pole. Then the circle is erased, moved down 1 pixel and then redrawn, giving the effect of gravity. When it reaches the bottom though, the line is infront of the circle, and I want the circle to be in front of the line.

Any ideas??

Thanks

Keywords & Tags: zorder, microsoft, visual basic, vb

URL: http://www.programmerbase.com/visual-basic/560822/
 
«« Prev - Next »» 6 helpful answers below.
Are we talking inside a PictureBox? Or using the Shape object?

Phreak

chemicalnova | Mon, 03 Dec 2007 18:47:00 GMT |

inside a picture box

theboy | Mon, 03 Dec 2007 18:48:00 GMT |

ZOrder refers to the level of the Objects on a Form. To do what you want, its just a matter of making sure the Line is drawn before the circle.

If that doesn't work, then perhaps storing the position and the next position of the circle, setting the autoredraw property to false, clearing the picturebox, setting the autoredraw property to true, drawing the line, drawing the circle.

Bit hard to explain, but I think it's clear enough. :)

chem

chemicalnova | Mon, 03 Dec 2007 18:49:00 GMT |

The problem i have there htough I think is ... i have more than 1 line, in fact I have 16. They are arranged in a 4x4, 2d but made to look 3d arrangement. So here need to have the line at the back with the circle on still behind all the other ones in front, and so on and so on... if you get what I mean??

theboy | Mon, 03 Dec 2007 18:50:00 GMT |

Can you attach what you have? I don't quite get what you mean.

chem

chemicalnova | Mon, 03 Dec 2007 18:51:00 GMT |

I tried to print screen with the app running but it wouldnt give me a screen shot so I drew (a very bad) picture in paint.

The verticle lines are in a controll array line(0) to line(15).

When the top of the pole is clicked, a circle drops to the bottom, but it goes behine all the poles. And, if a circle drops and it is infront of another circle, it wipes out the circle behind.

theboy | Mon, 03 Dec 2007 18:52:00 GMT |

Microsoft Visual Basic Hot Answers

Microsoft Visual Basic New questions

Microsoft Visual Basic Related Categories