this.TopMost = true not working?

TopMost is a property that is used to make sure one window is always shown above all others within an application. Microsofts example was a find and replace tool.

The difference you are finding is that Form1 was created as a modal dialog through the use of ShowDialog. Show dialog makes sure that your form must be closed before all other windows in the application can be used again. For example; using a form to gain user data to enter into a parent forms database.

Show is used when you don't mind if your user has finished with their dialog or not, such as allowing your user the chance to use some utility (e.g timer, stopwatch) that will assist within the main function of a program.

The only visual difference I can think of when using different .Net frameworks, is different windows dialogs such as the OpenFileDialog, that have been updated throughout the framework


It may help you;

frm.TopLevel = true;
frm.TopMost = true;

This link from Microsoft confirm that could be a Bug in Windows 7 and Windows Server 2008 R2 I've faced it in a Windows 7 Embedded system and the provided patch fix the problem so please consider to take a look :)

http://support.microsoft.com/kb/2587473/en-us

Hope it help!

Tags:

C#

.Net

Winforms