Jamie
Jamie

Reputation: 17

Moving controls forward and/or back in a form

I am trying to move a panel forward when I MouseDown, currently I am doing this using panel.BringToFront() Then when I MouseUp I want to send the panel back, i am trying to do this using panel.SendToBack() When i run, it moves the panel forward, but doesnt send it backwards again. Are there other ways to manipulate a control in the Z-axis other than using BringToFront or SendToBack.

I am using VB Express 2008.

Upvotes: 0

Views: 2399

Answers (1)

Nianios
Nianios

Reputation: 1426

Yes try:

 Me.panel.Parent.Controls.SetChildIndex(me.panel, zIndex) 'Put instead of zIndex the Zorder number that you want

Upvotes: 1

Related Questions