user1942557
user1942557

Reputation:

I can not seem to get my 'Form.TopMost = true' to work

I am trying to connect a checkbox to change 'Form.TopMost'.
Everytime I use the Form.TopMost i get the following error:

An object reference is required for the non-static field, method, or property 
'System.Windows.Forms.Form.TopMost.get' 
N:\VisualStudio\Projects\SpriteProject\YoutubeOverlay\Browser.cs    23  13  
YoutubeOverlay

Can anyone help on this?

Upvotes: 0

Views: 196

Answers (1)

madd0
madd0

Reputation: 9323

If you are changing the property in the code behind of the form, you should use:

this.TopMost = true;

Upvotes: 2

Related Questions