Click here to Skip to main content
15,905,967 members
Please Sign up or sign in to vote.
4.71/5 (3 votes)
See more:
How do I get a form to lock focus to where the user cannot switch to the parent window without closing it first?

Posted

False Chicken wrote:
How do I get a form to lock focus to where the user cannot switch to the parent window without closing it first?

It can be Simply Done by ShowDialog() method.

Form frmNew = new Form2();<br /> frmNew .ShowDialog();


Hope this will help you :-D

 
Share this answer
 
i think u want something which display at the top of every form and until it get close; user can't able to click on any other form. Something like Screen Locker.

Here is code
u have to add a timer with a very low interval which displays u r from on top most after every specified time.

on form load

this.WindowState = FormWindowState.Maximized;

and in timer tick event write the following code

this.TopMost = true;


this will lock u r entire screen until u unload(close ) the top most form. (Screen Locker).
plz rate ans and rply for any further help.
khaliljkazi@gmail.com
 
Share this answer
 


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900