-1

They seem similar but I am sure there must be some difference between the two. Does anyone have any insight? Maybe in where they are used?

Properties in question:

  • Window.Topmost

  • Form.TopMost

Sinatr
  • 20,892
  • 15
  • 90
  • 319

2 Answers2

1

They are controlling the same thing, but in different frameworks/libraries.

Window.Topmost

  • Namespace: System.Windows Assembly:
  • PresentationFramework.dll

Gets or sets a value that indicates whether a window appears in the topmost z-order.

https://learn.microsoft.com/en-us/dotnet/api/system.windows.window.topmost?view=netcore-3.1

Form.TopMost

  • Namespace: System.Windows.Forms
  • Assembly:System.Windows.Forms.dll

Gets or sets a value indicating whether the form should be displayed as a topmost form.

https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.form.topmost?view=netcore-3.1

Neil
  • 11,059
  • 3
  • 31
  • 56
0

Form.TopMost

A topmost form is a form that overlaps all the other (non-topmost) forms even if it is not the active or foreground form. Topmost forms are always displayed at the highest point in the z-order of the windows on the desktop. You can use this property to create a form that is always displayed in your application, such as a Find and Replace tool window.

Window.TopMost

A window whose Topmost property is set to true appears above all windows whose Topmost properties are set to false. In the group of windows that have Topmost property is set to true, the window that is currently activated is the topmost window. Likewise for the group of windows that have Topmost property is set to false.

Conclusion

Both are same and work equally.