Window focus

K

Kevin Spencer

If you use the body onblur you will not get this message. Example:

<body onblur="window.focus()">

However, the window may or may not get the focus depending upon the OS
settings on the client machine. At the very least, the icon in the task bar
will highlight, if the OS will not give the focus to the window. There's
nothing you can do if this setting is set on the client machine.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
G

Guest

window.onblur expects a function as an argument, but window.focus() is a
method.
Try changing the line to:
Response.Write("<script>window.onblur = new
function(){window.focus();}</script>");

Hope that helps.
 
W

Wei

I need the current window stay on focus. The user will have to click on
exit button to exit the window.
When I use the following code, I got an error: "Not implemented"
Code:
private void Page_Load(object sender, System.EventArgs e){

Response.Write("<script>window.onblur = window.focus();</script>");

}

Please help

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top