Click here to Skip to main content
15,911,315 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a application like following article : Sliding Panel in WPF - Code Scratcher[^] .In main I create a in center position .when left panel is expanded ,panel left is under WindowsFormsHost.How to set WindowsFormsHost to over other lay out

What I have tried:

Please tell me any solution for my problem
Posted
Updated 6-Aug-17 23:31pm

1 solution

Place your WindowsFormHost inside the Border control:
XML
<StackPanel Panel.ZIndex="2" Name="pnlLeftMenu" Orientation="Horizontal" Height="400" HorizontalAlignment="Left" Margin="-150,0,0,0">
	<Border BorderBrush="#AF1719" BorderThickness="1" Width="150" Background="#4C808080" >
	    <!-- Your WindowsFormHost goes here... -->
	</Border>
	<Grid>
		<Button Name="btnLeftMenuHide" Width="48" Height="48" Click="btnLeftMenuHide_Click" Content="Hide" Visibility="Hidden"/>
		<Button Name="btnLeftMenuShow" Width="48" Height="48" Click="btnLeftMenuShow_Click" Content="Show"/>
	</Grid>
</StackPanel>
 
Share this answer
 
Comments
Member 13338759 7-Aug-17 5:55am    
Yes,but instead of using border ,I using stackpanel
Graeme_Grant 7-Aug-17 6:21am    
The Border control is holding the size of the panel... Check the offsets in the storyboard if you change the size of the [Border] container...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900