Murali R

Murali R

  • NA
  • 41
  • 7.6k

Top Alignment not same

Oct 14 2015 10:52 AM

I made simple page which contains only one image and one combo box.

I placed them inside a canvas.

The top alignment is not unique for both control.I found some invisible border is around combobox.

How to display both image and combo box such that both are horizontally same.

My code:

<Grid >

<Canvas Background="Gray" Margin="10,217,10,364">
<Image Source="/images/test.png" Height="51" Width="53" Canvas.Top="0" Canvas.Left="5" VerticalAlignment="Top" HorizontalAlignment="Center"/>
<ComboBox x:Name="testCombo" Height="51" Width="247" Canvas.Top="0" Canvas.Left="57" VerticalAlignment="Top" HorizontalAlignment="Center" BorderBrush="Black">

<ComboBoxItem Content="One" IsSelected="True"/>
<ComboBoxItem Content="Two" />
<ComboBoxItem Content="Three" />
<ComboBoxItem Content="Four" />
</ComboBox>

</Canvas>

</Grid>


Answers (1)