locked
Using ScrollViewer to view HTML files (using Frame) RRS feed

  • Question

  •  
    How do I put my Frame inside a ScrollViewer and force the Frame to use the ScrollViewer's functionality instead of its own?  For example, I have this code:

    <ScrollViewer> 
            <Frame   
            Name="Frame1"    
            Width="Auto"   
            Height="Auto"   
            VerticalAlignment="Stretch"   
            HorizontalAlignment="Stretch"   
            NavigationUIVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Disabled" /> 
    </ScrollViewer> 

    I load an html file into the frame with this:

    Frame1.Navigate(new System.Uri("myPage.html", UriKind.RelativeOrAbsolute)); 

    This works great except the Frame has Horizontal and Vertical Scroll Bars and the ScrollViewer is essentially unutilized.  The Vertical ScrollBar of the ScrollViewer is grayed out and and Frame has total control over the HTML page.  Is there a way to host the Frame inside the ScrollViewer so that I can load an HTML file into the Frame and actually scroll through it using the ScrollViewer functionality?  Also, I would prefer to have a transparent background for the ScrollViewer and Frame as well, using the background from my main window instead.  Is this possible?  Thanks.

    Sean
    Monday, October 6, 2008 11:37 PM