1

When we use the built-in (Windows 7) On-Screen Keyboard, it stays on top of a TopMost form, even when the form is clicked on and activated.

We are building a custom OSK to prevent the user from having too much power with the built-in OSK, but even though it's TopMost property is set to True, it still gets hidden behind the main form when it is selected!

How can we make the form operate like the built-in On-Screen Keyboard and make it stay on top of even a TopMost form?

xofz
  • 5,600
  • 6
  • 45
  • 63
  • What are you doing that the default OSK "gives too much power"? – Scott Chamberlain Dec 02 '13 at 21:49
  • I just tried that and the second form still stays on top even when the main form is selected –  Dec 02 '13 at 21:50
  • The screen for the computer gets filled up by our application. With no physical keyboard attached, they do not have the ability to close down the application (without an admin password). If they have the built-in OSK available, they are able to ctrl-alt-delete or something else to force-close the application. – xofz Dec 02 '13 at 21:51
  • There are also additional keys I added that send a string of keys in a row, for commonly-typed key patterns. (e.g., "true" and "false" keys) – xofz Dec 02 '13 at 21:53
  • I turned off TopMost on the main form and used the solution here: http://stackoverflow.com/questions/505167/how-do-i-make-a-winforms-app-go-full-screen to prevent the taskbar from being shown by our full-screen application. – xofz Dec 02 '13 at 22:06
  • 2
    OSK fights back by periodically checking if it is still on top. If not then it cheats and changes the Z-order. Avoid these kind of hacks by making your keyboard an *owned* window. In Winforms that's done with the Show(owner) overload. – Hans Passant Dec 02 '13 at 22:33

0 Answers0