![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | 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!! |
My System Specs![]() |
| | #2 (permalink) |
| | 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!! > |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Is it possible to include XAML files into another XAML file? | .NET General | |||
| Desktop Sizing | Vista installation & setup | |||