Programmatically Press F11 Key on Button Click Event to View Browser in Full Screen Mode

9:30 AM Posted by Srikanth Gupta

Clicking on F11 key will change the browser view mode into full screen mode. To implement it programmatically use the following code.

Add following Javascript code between <head></head> tags.

<script type=""type/javascript>
      function maxwin() {

            var wscript = new ActiveXObject("Wscript.shell");
            if (wscript!=null)
            wscript.SendKeys("{F11}");

        }
<script>

Call javascript function in button click event as below:

 <asp:Button ID="Button1" OnClientClick="maxwin();" runat="server" Text="Button"
      onclick="Button1_Click" />                             

  

0 comments:

Post a Comment