开发者

silverlight scrollviewer and canvas with h/w set. Cant get vertical bar to hide even when lots of room

开发者 https://www.devze.com 2023-03-27 17:17 出处:网络
Silverlight project with tabcontrol hosting canvas objects. I want to wrap my entire tabcontrol with a scrollviewer so that on a short display you can scroll vertically to see the whole area on my can

Silverlight project with tabcontrol hosting canvas objects. I want to wrap my entire tabcontrol with a scrollviewer so that on a short display you can scroll vertically to see the whole area on my canvas.

When I run my project my scrollviewer vertical bar is always showing even when there's more room vertically than needed for a scrollbar.

All I am trying to accomplish here is a min resolution of 1280x768 to be scrollable and anything bigger than that have the scrollbars hide. My laptop is only 768 tall, but my canvases were developed with 1280x1024 in mind. So I would like a way to set this up so that everyone can scroll or just see the canvas all at once depending on their resolution.

Anyone have any ideas why it is always visible? I've tried setting canvas width and height. I tried setting stretch on alignments on the outer grid. Saw both those tips while searching other issues similar to mine.

Some code:

 <Grid x:Name="LayoutRoot" MinHeight="768" MaxHeight="1024" MinWidth="1024" MaxWidth="1280" Background="#FF6A6868" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                          <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.775*"/>
                <ColumnDefinition Width="0.225*"/>
            </Grid.ColumnDefinitions>
          <ScrollViewer VerticalScrollBarVisibility="Auto" MinHeight="768" MaxHeight="1000" MinWidth="1024" MaxWidth="1280" Width="1280" Grid.ColumnSpan="2">
    <sdk:TabControl TabStripPlacement="Top" Grid.ColumnSpan="2">
                <sdk:TabItem Margin="0" Head开发者_C百科er="Main Floor">
                   <Canvas x:Name="Main_Floor" HorizontalAlignment="Left" Height="1024" MinHeight="768" UseLayoutRounding="False" VerticalAlignment="Top" Width="1280" >

....lots of child canvas items in my "Main Floor" canvas. Child canvas objects contain lots of path objects. None which are taller or wider than the main floor canvas width/height.

      <sdk:TabItem Margin="0" Header="Mezzanine">
                    <Canvas x:Name="Upstairs" HorizontalAlignment="Left" Height="1000" UseLayoutRounding="False" VerticalAlignment="Top" Width="1280">

..another tab. Same deal with child canvas objects.


solution turned out being a hidden height value nested deep in the application. I did things the hard way and recreated each tab on my project piece by piece and that's when I found it.

Thanks HiTechMagic for your assistance.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号