locked
Why is ScrollViewer looking at me?!! RRS feed

  • Question

  • I have a few controls inside a ScrollViewer and I can add more (no difference), but when I run application and click its scrollbar it does nothing at all!!
    I have installed SilverLight 4 beta tools and everything, and I am using "Microsoft Expression Blend Preview for .Net 4". Here is the end of my SilverLight project where I have added the Scrollviewer:
        	<ScrollViewer x:Name="scrollV" Margin="8,0,8,8" Cursor="Hand" VerticalAlignment="Bottom" Canvas.ZIndex="1" Opacity="0.5" Width="320">
    
        		<ScrollViewer.Background>
    
        			<SolidColorBrush Color="#FF5C5C5C"/>
    
        		</ScrollViewer.Background>
    
        		<StackPanel x:Name="stackPanel1" Height="60" Width="549">
    
        			<RichTextArea x:Name="rtxtDescription" FontWeight="SemiBold" Foreground="#FFFDFBFB" Margin="0" Width="300" HorizontalAlignment="Left">
    
        				<RichTextArea.Background>
    
        					<SolidColorBrush Color="#FF1B1717" Opacity="0.5"/>
    
        				</RichTextArea.Background>
    
        			</RichTextArea>
    
        			<RichTextArea x:Name="rtxtAdmin" Margin="0" Width="300" HorizontalAlignment="Left" ScrollViewer.VerticalScrollBarVisibility="Visible"/>
    
        			<TextBox x:Name="txtRm" HorizontalAlignment="Left" Margin="0" TextWrapping="Wrap" Width="66"/>
    
        		</StackPanel>
    
        	</ScrollViewer>
    
        </Grid>
    
    </UserControl>
    
    
    Why is it not doing anything?!!
    Thursday, February 25, 2010 6:58 AM

Answers

  • ok, I played around with it. Just had to to set StackPanel height and width to auto (or remove its height and width attributes). Couldn't see stackPanel has dimensions before!
    • Marked as answer by Pitiko2 Thursday, February 25, 2010 7:22 AM
    Thursday, February 25, 2010 7:22 AM