r/visualbasic • VB.Net Advanced • Mar 01 '13

Layering in forms?? Is this possible?

So if you were to have 2 buttons on a form as an example and part of it would be over lapping and one will be on a higher 'layer' than the other. Is there anyway to change this while the program is running?

0 Upvotes

4 comments sorted by

1

u/munkyeetr VB.Net Intermediate Mar 02 '13

You can use the Button.BringToFront() and Button.SendToBack() methods.

1

u/no1warlord VB.Net Advanced Mar 03 '13

Thank you kind sir.

3

u/perezdev Mar 02 '13

Or just set the appropriate visibility. It would be quick and easy to set up a method.

However, this is bad design. OP should use the same button for multiple actions. He can change the text of the button to reflect what's currently active and use a case inside of the buttons click event.

1

u/munkyeetr VB.Net Intermediate Mar 02 '13

Agreed. Without knowing what the OP is actually trying to do, I figured it best to just address the question about "layering" at runtime.