Reputation:
is it possible to overlay a control (lets say a rich text box or a link label) over onother control at a specific position on a Winform?
I have did some test with GDI+ but without luck...
Upvotes: 1
Views: 9822
Reputation: 1037
Do you want both to be visible at the same time? If so, check out Giving Your Control a Transparent Background.
If it's simply a matter of putting two controls in the same place and showing one or the other, you can use Control.BringToFront()
and .SendToBack()
, as well as individually controlling their visibilities.
Finally, if it's text you want to draw on top of another control, you might want to look into drawing that text yourself from that other control - the TextRenderer
class makes it very easy to do so.
Upvotes: 2
Reputation: 60001
You can place one control on top of the other, but it will obscure the one under it. Some controls (like Label) support transparent background, in which case it won't obscure the control under it.
Upvotes: 2