Custom WinForms Controls - Forcing “Always on Top”
Having read the following question from MattBerry on the student forum for the MCAD I am studying towards: Does anyone know how to make a custom control the top most control on a form i.e. its z-order. I know forms create the z-order in the order the controls are created, and I know you can use the control.BringToFront method after all controls have been created. What I want to know is, is it possible to set this z-order in the custom control's code, so that it can be encapsulated? It sparked my curiosity, can it be done? I have never tried anything like this myself. And yes, there is a side of me that would get REALLY pissed off with using a control that did this, but I thought “what the hell?” lets have a look and see what we can do. Now, a bit of disclosure, it has been a while since I done any Windows development, so this may well be possible to do a lot easier, but hey, it took me 15 minutes :P Getting Started I had no real ide