none
Silverlight not scrolling in browser

    Question

  • I have a silverlight2b2 design that is around 900px in height.  It looks fine when I'm at a high resolution and can see the whole thing, but on other computers, the content is simply cut off.  Is there a way to make it so that users could scroll down in the web browser to see more of the content of the silverlight app?  I am using the default ASPX testpage to figure out how to do this.

    Thursday, June 19, 2008 11:19 PM

Answers

  •  see the html or aspx page you are putting your silverlight content give height="900" insteed of 100%

    Friday, June 20, 2008 12:22 AM
  • Hi,

    If you r using IE7 ,then it is not possible to extend your browser height to certain value .I think this value is near about 750. So there is only way to open your browser in full screen mode or enable scrolling.

    Thanks

    Hitesh

     

    If this is the answer plz mark as answer

     

    Tuesday, June 24, 2008 6:44 AM
  • Try the following:

    In your Web Application, place the Silverlight application in a DIV and make the DIV scrollable.
    In the Style attribute of the Div put: overflow : auto;

    Let me know if this fixes the error.

    Thanks,
    Sorcerdon

    Tuesday, June 24, 2008 7:06 PM

All replies

  •  see the html or aspx page you are putting your silverlight content give height="900" insteed of 100%

    Friday, June 20, 2008 12:22 AM
  • Hi,

    If you r using IE7 ,then it is not possible to extend your browser height to certain value .I think this value is near about 750. So there is only way to open your browser in full screen mode or enable scrolling.

    Thanks

    Hitesh

     

    If this is the answer plz mark as answer

     

    Tuesday, June 24, 2008 6:44 AM
  • Try the following:

    In your Web Application, place the Silverlight application in a DIV and make the DIV scrollable.
    In the Style attribute of the Div put: overflow : auto;

    Let me know if this fixes the error.

    Thanks,
    Sorcerdon

    Tuesday, June 24, 2008 7:06 PM
  • I met this problem too, I tried to change the height from percentage to pixel, but this can not take effect.(The explorer can not allow this).

    Finally I found you only need change the height value from 100% to upper(e.g. 120%), and if the html and the body style is auto scroll, the silverlight area will expand.

    Hope this helps.Smile

    Monday, July 07, 2008 2:03 AM
  • I also have this problem as well.  I am using IE8 and the html source code has height listed several places in it.  The html source code is listed below:

    1    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    2    <html xmlns="http://www.w3.org/1999/xhtml" >
    3    <!-- saved from url=(0014)about:internet -->
    4    <head>
    5        <title>Casual Game News Engine</title>
    6     
    7        <style type="text/css">
    8        html, body {
    9    	    height: 100%;
    10   	    overflow: auto;
    11       }
    12       body {
    13   	    padding: 0;
    14   	    margin: 0;
    15       }
    16       #silverlightControlHost {
    17   	    height: 100%;
    18       }
    19       </style>
    20       
    21       <script type="text/javascript">
    22           function onSilverlightError(sender, args) {
    23           
    24               var appSource = "";
    25               if (sender != null && sender != 0) {
    26                   appSource = sender.getHost().Source;
    27               } 
    28               var errorType = args.ErrorType;
    29               var iErrorCode = args.ErrorCode;
    30               
    31               var errMsg = "Unhandled Error in Silverlight 2 Application " +  appSource + "\n" ;
    32    
    33               errMsg += "Code: "+ iErrorCode + "    \n";
    34               errMsg += "Category: " + errorType + "       \n";
    35               errMsg += "Message: " + args.ErrorMessage + "     \n";
    36    
    37               if (errorType == "ParserError")
    38               {
    39                   errMsg += "File: " + args.xamlFile + "     \n";
    40                   errMsg += "Line: " + args.lineNumber + "     \n";
    41                   errMsg += "Position: " + args.charPosition + "     \n";
    42               }
    43               else if (errorType == "RuntimeError")
    44               {           
    45                   if (args.lineNumber != 0)
    46                   {
    47                       errMsg += "Line: " + args.lineNumber + "     \n";
    48                       errMsg += "Position: " +  args.charPosition + "     \n";
    49                   }
    50                   errMsg += "MethodName: " + args.methodName + "     \n";
    51               }
    52    
    53               throw new Error(errMsg);
    54           }
    55       </script>
    56   </head>
    57    
    58   <body>
    59       <!-- Runtime errors from Silverlight will be displayed here.
    60   	This will contain debugging information and should be removed or hidden when debugging is completed -->
    61   	<div id='errorLocation' style="font-size: small;color: Gray;"></div>
    62    
    63       <div id="silverlightControlHost">
    64   		<object data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%">
    65   			<param name="source" value="Casual Game News Engine.xap"/>
    66   			<param name="onerror" value="onSilverlightError" />
    67   			<param name="background" value="white" />
    68   			<param name="minRuntimeVersion" value="2.0.31005.0" />
    69   			<param name="autoUpgrade" value="true" />
    70   			<a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">
    71        			<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
    72   			</a>
    73   		</object>
    74   		<iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>
    75       </div>
    76   </body>
    77   </html>
    78   
    79   
    

     I have tried experimenting around by changing some of the height values but I have not been successful yet.

     Jason

    Wednesday, May 20, 2009 5:58 PM