Quote Originally Posted by jmcilhinney View Post
It's not inside btn_OnTop. It's inside the Click event handler for btn_OnTop, which is the btn_OnTop_Click method.

If you want to refer to the object that raised the event inside an event handler then you use the 'sender' parameter. In this particular case though, there's really no need to because you know for a fact that it will be btn_OnTop so you can just use the that member variable. For handlers of events for multiple objects or dynamically created objects or when the handler is not in the form containing the control though, using the 'sender' may be the only way.

By the way, your code is much more complex than it needs to be. This:
Code:
btn_OnTop.Text = (this.TopMost == false) ? "On Top" : "Not On Top" ;
would be better written like this:
Code:
btn_OnTop.Text = this.TopMost ? "Not On Top" : "On Top";
but even moreso, this:
Code:
this.TopMost = (this.TopMost == false) ? true : false ;
could be written like this:
Code:
this.TopMost = !this.TopMost
Not only did you answer my question,
but gave me more input as well.
Always good to make the codes cleaner.
Thank you.