how to open screen on full screen
how i can open my asp.n开发者_运维问答et program on full screen (like i press F11)
Through C# code ?
thanks
Use javascript
Button1.Attributes.Add("onclick","window.open('Default.aspx','','fullscreen=yes')");
not exactly full screen but pretty similar
Have a look at this. Instead of linking, you can redirect your user from your default page with the proper javascript.
Maybe you can send a F11 key pressed command from your application once it's loaded to force your browser to go full screen?
I doubt if there is a clean way of doing this as the F11 fullscreen command is handled by your internet browser.
I think OP is talking about asp.net application so the "program" here is browser.
If it is true, you need client-side javascript to do that. something like this:
<script language="JavaScript1.2">
top.window.moveTo(0,0);
if (document.all)
{ top.window.resizeTo(screen.availWidth,screen.availHeight); }
else if (document.layers || document.getElementById) {
if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth)
{
top.window.outerHeight = top.screen.availHeight;
top.window.outerWidth = top.screen.availWidth;
}
}
</script>
- document.all works for Internet Explorer while document.layers works for Other browsers.
- top refers to the window that is on top of all other windows in the window object hierarchy.
- top.window.moveTo(0,0) will display the top window at these coordinates ie. the upper left corner of the screen.
- resizeTo(x,y) will resize the window to the size specified.
- availWidth and availHeight are properties of the screen object which can detect the available screen space.
Hope this helps...
精彩评论