Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Vertical scroll bar not displayed.  Cuts off silverlight app to the height of web browser.

Posted on 2008-06-25
3
Medium Priority
?
5,542 Views
Last Modified: 2013-11-12
I have a 800 x 825 pixel silverlight app that I'm displaying from within a html web page.  Everything looks fine when I view the app from the web browser of my desktop PC where I have a big monitor, however when I view it from the web browser on my laptop the application is cut off vertically as the window of my laptop web browser is only about 800 pixels tall.  What I would have expected is that I would have had a vertical scroll bar on the side of the browser.  You can actually view the page in question at www.silverlightwebapps.com.

Below is a snippet from the page.  I tried adding "overflow: scroll" to the style section to see if that would make the scroll bars appear but it didn't.

    <style type="text/css">
    html, body {
          height: 1000px;
          overflow: scroll;
    }
    body {
          padding: 0;
          margin: 0;
    }
    #silverlightControlHost {
          height: 1000px;
          width:800px;
          overflow:scroll;
          
    }
    </style>

...later within the body section I have the silverlight object tag
<div id="silverlightControlHost">
<object data="data:application/x-silverlight," type="application/x-silverlight-2-b2" width="100%" height="1000px">

0
Comment
Question by:mdobbles
3 Comments
 
LVL 1

Expert Comment

by:kkretsch
ID: 21873566
Just to be shure it isn't a silverlight problem:
Did you try to use an image of the same dimension instead of the whole object tag?
If that doesn't scroll like you would like it is a simple css/html problem. In that case I would reduce all the redundant height attributes but leave the height on the image tag. SO it should scroll by itself.
0
 
LVL 8

Expert Comment

by:adler77
ID: 21889584
The Silverlight animation is way off the top and left for me, but I do have two separate scrollbars. Try setting the dimensions only in the silverlightControlHost div (set it exactly to the dimensions of the app, 800x825. For the Silverlight params, use 100% for height and width.
0
 

Accepted Solution

by:
mdobbles earned 0 total points
ID: 21926137
It turns out the problem was that whenever you build an application in ExpressionBlend the default.html file is overwritten by ExpressionBlend, so all the things I changed actually we're not really changed.  The key was to create a new web project in Visual Studio 2008 and include the ExpressionBlend project as a subproject of the VS2008 web project.  That way you can manage both the website part of the project and the Silverlight part.  I'm going to put a tutorial on this topic at my website SilverlightWebApps.com here shortly.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…

824 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