Hi:
I have a winforms custom control that I'm attempting to host in a WindowsFormControl.
I seem be running into some issues getting the height of the control to behave correctly.
I've got a grid, that contains a StackPanel, which contains the actual embedded WindowsFormControl. I would like the WindowsFormControl's height to take up all the available height in the StackPanel.
The actual winforms custom user control's height behaves correctly as it fills the height area available within the WindowsFormHost.
I'm not entirely clear on what's going on.
Here is XAML fragment containing the control definitions:
<Grid Grid.Row="0" removed="#7A66BAD2">
<Grid.RowDefinitions>
<RowDefinition Height="9*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" >
<WindowsFormsHost Name="RPIWinformsHost" Height="700"
removed="Orange"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Margin="30,10,30,10">
<rpiRTFControl:RPIReportDesignControl Name="RPIRTFControl" />
</WindowsFormsHost>
</StackPanel>
<Border BorderBrush="#CCCCFF" Grid.Row="1" BorderThickness="6"
HorizontalAlignment="Stretch" Margin="30,0,30,0">
<StackPanel Name="spCommands"
Orientation="Horizontal">
<Button Name="btnTest" Content="Test" Height="25" Width="134"
FontSize="13" FontWeight="Bold"
Margin="10,0,10,0"
Click="btnTest_Click" />
</StackPanel>
</Border>
</Grid>
What is the correct technique/trick for having this behave correctly?
Thanks,
JohnB