Tommy B.
Tommy B.

Reputation: 3639

Adding programmatically a control on top of others

I'm looking for adding a control on top of others controls during runtime.

I read that the only way of playing with the Z-Order of controls is by playing with the order of the controls inside the Form.Controls Collection. I find this solution very weird and weak and I'm looking for an alternative.

Does anyone has an idea? I just want to make some kind of modal dialog that'll show below another user control to notice the user that the user control is currently doing something.

Edit: I tried using Control.BringToFront() but it doesn't work at all.

Thanks a lot!

Upvotes: 1

Views: 6546

Answers (1)

SLaks
SLaks

Reputation: 887255

You're looking for the BringToFront() method.

Upvotes: 5

Related Questions