Link to home
Create AccountLog in
Avatar of JElster
JElsterFlag for United States of America

asked on

WPF Sizing a Border so it doesn't go out of view.. remains and fills the page

Hi..
I have border and in that border,  I have another border and in that I have textbox.
I need to keep the borders 'on the page' so that when the text gets huge thet borders remain filled on the page and don't go off the page and get cut off.  How can I size the borders so that they fill the whole  page when the text is large and how can I add scrollview

My current xaml looks like this


                <Border Grid.Row="1" x:Name="brdSearchResults" CornerRadius="3" Padding="5" Margin="10,10,10,10" BorderBrush="Blue"  BorderThickness="1" Background="White">
             
                    <StackPanel Orientation="Vertical">

                        <Border x:Name="brdUserNotesResults" CornerRadius="3" Grid.Row="1" Background="LightGray" BorderThickness="1,1,1,1" Margin="3,3,3,3">
                                                     
                            <StackPanel Orientation="Vertical">
                           
                            <TextBlock x:Name="txtResult"   Margin="5,0,5,5"  FontWeight="Bold"  HorizontalAlignment="Center" VerticalAlignment="Center" />

....................
ASKER CERTIFIED SOLUTION
Avatar of ToddBeaulieu
ToddBeaulieu
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer