Always On Top

I got this after doing that:

[C# Error] AssemblyInfo.cs(315): An object reference is required for the nonstatic field, method, or property 'System.Windows.Forms.Form.TopMost'

lets just say my forms named WinForm, what would be the syntax to use that command properly.
 
Yes but I'm trying to get it so that the user can check the Always Stay On Top box so no other programs get in the way. So how would I go about making it true and false I tried:

WinForm.TopMost = true;

but it gave me that error above.
 
Is WinForm the name of your form class, or does it reference a specific instance of your form? The latter is required to use that property since it is specific to each instance.
 
Well...When I click the form, that's the name of it. I don't see anything that has a higher power than that as it's my only form. And if I set it to true in the properties, it works, but I need it to be able to turn on and off and I guess my syntax is off.
 
Back
Top