Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Positioning of a container with height using Margin WPF

$
0
0

I am using a webbrowser control to show a html on a awesomium webbrowser ocntrol and structre of window is like this

<Grid HorizontalAlignment="Center" VerticalAlignment="Center"><my:WebControl Name="bookview1"  />                                    </Grid>

Now i want to show a container above webbrowser at a specific point so i added code to the Grid Container

<Grid HorizontalAlignment="Center" VerticalAlignment="Center"><my:WebControl Name="bookview1"  />                 <Border BorderBrush="Black" BorderThickness="2" CornerRadius="3" Margin="30,30,0,0" Name="MenuArea"  Background="Red" ><Grid><Button Name="CloseSelectionMenu"  Click="CloseSelectionMenu_Click"   Style="{StaticResource ResourceKey=CircleButton}" ToolTip="Close">X</Button><TextBlock FontWeight="Bold" FontSize="12" Name="lblSelectionCurrent"  TextWrapping="Wrap">My cs io sid</TextBlock></Grid></Border></Grid>

Now the position is ok but width and height is occupying the whole space remaining like in the image

. So i set <Border  Width="100" Height="200"  > but now margin property is not correct , the Border container is closer to center

Here Margin is not as expected

How can i position the container with specific dimension using Margin


Thanks ***Share Knowledge to gain more***


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>