![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Sizing a FlowDocumentPageViewer in XAML Greetings, I have a Window defined roughly as a Grid with a couple of controls and a Stackpanel. The Stackpanel occupies the bottom third of the Grid. The second component within the Stackpanel is a FlowDocumentPageViewer. I'd like the height of the FlowDocumentPageViewer to automatically fill the bottom part of the Stackpanel and therefore the bottom part of the main Window as well. Unfortunately the behavior I see is the FlowDocumentPageViewer extending well below the viewable part of the Window, hiding the controls that allow the user to scroll from page to page. I can hard- code the height easily enough (I use 200 in my code snippet below), but that defeats the point of having a Stackpanel and doesn't allow for resizing, etc. Is there a way to have the FlowDocumentPageViewer automatically resize to fit the remainder (i.e. bottom portion) of the stackpanel? My guess is that there is some markup extension somewhere that fits the bill, but finding it eludes me. Following is the window definition, without the details: <Window x:Class=...> <Grid> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Canvas Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Grid.RowSpan="2"> <MyControl:ctrlMyControl x:Name="m_ctrlClassicalWave" Canvas.ZIndex="100" Canvas.Top="90" Canvas.Left="100"/> <Image Canvas.Top="50" Canvas.Left="50"> ... </Image> <Ellipse Canvas.Top="50" Canvas.Right="100" Width="30" Height="100"> ... </Ellipse> </Canvas> <StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"> <RichTextBox Height="18" Width="100"> ... </RichTextBox> <FlowDocumentPageViewer Height="200"> <FlowDocument> <Paragraph> A bunch of paragraphs and text here that goes on for several pages.... </Paragraph> </FlowDocument> </FlowDocumentPageViewer> </StackPanel> </Grid> </Window> Thanks in advance!! |
| | #2 (permalink) |
| Guest | Re: Sizing a FlowDocumentPageViewer in XAML You could use a DockPanel, or try HorizonalAlignment=Stretch & VerticalAlignment=Stretch. "Mapsread" <cw_chw@yahoo.com> wrote in message news:1184294391.081563.178660@n2g2000hse.googlegroups.com... > Greetings, > > I have a Window defined roughly as a Grid with a couple of controls > and a Stackpanel. The Stackpanel occupies the bottom third of the > Grid. The second component within the Stackpanel is a > FlowDocumentPageViewer. I'd like the height of the > FlowDocumentPageViewer to automatically fill the bottom part of the > Stackpanel and therefore the bottom part of the main Window as well. > Unfortunately the behavior I see is the FlowDocumentPageViewer > extending well below the viewable part of the Window, hiding the > controls that allow the user to scroll from page to page. I can hard- > code the height easily enough (I use 200 in my code snippet below), > but that defeats the point of having a Stackpanel and doesn't allow > for resizing, etc. > > Is there a way to have the FlowDocumentPageViewer automatically resize > to fit the remainder (i.e. bottom portion) of the stackpanel? My guess > is that there is some markup extension somewhere that fits the bill, > but finding it eludes me. > > Following is the window definition, without the details: > > <Window x:Class=...> > <Grid> > <Grid.RowDefinitions> > <RowDefinition/> > <RowDefinition/> > <RowDefinition/> > </Grid.RowDefinitions> > <Grid.ColumnDefinitions> > <ColumnDefinition/> > <ColumnDefinition/> > </Grid.ColumnDefinitions> > <Canvas Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" > Grid.RowSpan="2"> > <MyControl:ctrlMyControl x:Name="m_ctrlClassicalWave" > Canvas.ZIndex="100" Canvas.Top="90" Canvas.Left="100"/> > <Image Canvas.Top="50" Canvas.Left="50"> > ... > </Image> > <Ellipse Canvas.Top="50" Canvas.Right="100" Width="30" > Height="100"> > ... > </Ellipse> > </Canvas> > <StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"> > <RichTextBox Height="18" Width="100"> > ... > </RichTextBox> > <FlowDocumentPageViewer Height="200"> > <FlowDocument> > <Paragraph> > A bunch of paragraphs and text here that goes on for > several pages.... > </Paragraph> > </FlowDocument> > </FlowDocumentPageViewer> > </StackPanel> > </Grid> > </Window> > > Thanks in advance!! > |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Is it possible to include XAML files into another XAML file? | star-italia | .NET General | 6 | 06-12-2008 04:56 AM |
| picture down sizing | ken | Vista music pictures video | 2 | 01-25-2008 12:05 AM |
| Sizing all columns. | Dave | Vista General | 0 | 07-10-2007 01:20 PM |
| launching different XAML aplication from another XAML app | SenthilVel | Avalon | 0 | 03-31-2007 09:40 PM |
| How to deploy an XAML-based App with its XAML-UI-File? | Solveigh | Avalon | 11 | 11-08-2006 07:50 AM |