Solved

Web Application browser window size

Posted on 2004-10-19
10
252 Views
Last Modified: 2010-04-23
Hi,

     This may be a dumb question, but I like to ask those.  Can I program my web application so that when it's run, the browser that opens is full screen?  I'm getting a small browser window and while debugging it's getting annoying to have to maximize it every time.

JP
0
Comment
Question by:gleznov
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 12348386
If this is only debugging problem, there is a simple way. Run Internet Explorer, set it's window to normal (non-maximized) state and resize it so that it fills almost all screen. Close Internet Explorer. Now every new IE instance launched from Visual Studio is "almost" maximized.
0
 

Author Comment

by:gleznov
ID: 12349296
Anyway to hardcode maximization?  I may want this to be standard with anyone who uses the program later?

JP
0
 
LVL 10

Expert Comment

by:james-ct16
ID: 12368275
hi

If you dont mind doing it in javascript, so client side the following code is what i use to maximise the screen, has to be said i dont particuly like it as i consider it to be rude when someone else resizes my browser for me

regards

james

code follows
---------------------------------
//maximise the screen
function maxScreen()
{
  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.outerHeight = screen.availHeight;
    }
    if (top.window.outerWidth<screen.availWidth)
    {
      top.window.outerWidth = screen.availWidth;
    }
  }
}

// script to get screen height and width


function getXHeight()
{
  return top.window.outerHeight;
}

function getYHeight()
{
  return top.window.outerWidth;
}
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

Author Comment

by:gleznov
ID: 12368708
Hey James,

     I agree about the resizing rudeness, but this is only a company intranet program, and a standardized maximized-browser isn't so rude in this context.  Could you possibly tell me how to integrate that Java code into my VB.NET program?  The last time I used java was when I was designing webpages using DOS Edit and notepad...

JP
0
 
LVL 10

Accepted Solution

by:
james-ct16 earned 125 total points
ID: 12368946
hi
its fairly simple to integrate, paste the above code into the [filename].aspx page in the html header section in between
<script type="text/javascript">
<!--
//code here

-->
</script>

and then in the body tag add the following attribute onload="javascript:maxScreen()"

eg
<body bgcolor="#000000" onload="javascript:maxScreen()">


this change will of course have to be made on each page or to your header user control if you wrote one.

notes

As this uses the onload function it is not particulary mozilla/firefox friendly im currently looking to find a better was of doing this and shall let you know if i find one

james
0
 

Author Comment

by:gleznov
ID: 12399319
Won't any changes I make to the .aspx code be changed every time I resave the file in visual basic .net?

JP
0
 
LVL 10

Expert Comment

by:james-ct16
ID: 12399448
hi
no, there are no changes needed evertime you save the page. you just add that to each page you to maximise. vs.net will not rewrite this code. if you want i can write out a complete page example, but i have posted everything that you need to do it.

regards james
0
 

Author Comment

by:gleznov
ID: 12399634
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="DBItem.aspx.vb" Inherits="OEL2.DBItem"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
      <HEAD>
            <title>DBItem</title>
            <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
            <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
            <meta content="JavaScript" name="vs_defaultClientScript">
            <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
      
            <script type="text/javascript">
            <!--
            //maximise the screen
            function maxScreen()
            {
              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.outerHeight = screen.availHeight;
                }
                if (top.window.outerWidth<screen.availWidth)
                {
                  top.window.outerWidth = screen.availWidth;
                }
              }
            }
            // script to get screen height and width
            function getXHeight()
            {
              return top.window.outerHeight;
            }
            function getYHeight()
            {
              return top.window.outerWidth;
            }
            -->
            </script>

      </HEAD>
      <body MS_POSITIONING="GridLayout" onload="javascript:maxScreen()">
            <form id="Form1" method="post" runat="server">
                  <asp:label id="Label1" style="Z-IND.....

I have a question - I should have checked before I accepted in case you never see this - but this is what I did by clicking my form and choosing View HTML - it still doesn't work?

JP
0
 
LVL 10

Expert Comment

by:james-ct16
ID: 12400180
hi

i have just tested the following code in both ie and firefox (latest build) and it works in both. this is undoubtidly (sorry about spelling) a silly question but you do have javascript turned on, i presume you do. in that case do you have any non standard popup killers that may be stopping the onload event?


regards

james

<html>
     <head>
          <title>DBItem</title>
          <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
          <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
          <meta content="JavaScript" name="vs_defaultClientScript">
          <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
     
          <script type="text/javascript">
          <!--
          //maximise the screen
          function maxScreen()
          {
            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.outerHeight = screen.availHeight;
              }
              if (top.window.outerWidth<screen.availWidth)
              {
                top.window.outerWidth = screen.availWidth;
              }
            }
          }
          // script to get screen height and width
          function getXHeight()
          {
            return top.window.outerHeight;
          }
          function getYHeight()
          {
            return top.window.outerWidth;
          }
          -->
          </script>

     </HEAD>
     <body MS_POSITIONING="GridLayout" onload="javascript:maxScreen()">
     <p>my body</p>
     </body>
     </html>
0
 

Author Comment

by:gleznov
ID: 12400244
JAVA's enabled according to options (security as well as advanced tabs in IE/options).  However, I'm reading a microsoft book and just also tried to do a new page (in the HTML button code, add onclick="window.open('web.page')" and that's not working either.  Wonder what I've got wrong in here

JP
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question