Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted

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.

  • *Experts*
Posted
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.
Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...