Shahin
Shahin

Reputation: 12861

Move Image on window WPF

Here is my code :

                    <Image x:Name="Layer_22_copy" Height="542" Canvas.Left="16" Opacity="0.522" Source="gammon2_Images\Layer 22 copy.png" Canvas.Top="13" Width="315"/>

how can i change position of this image on Code Behind? i am new in WPF. thank you.

Upvotes: 0

Views: 1905

Answers (2)

Prince Ashitaka
Prince Ashitaka

Reputation: 8763

You can set the Margin Property like

Layer_22_copy.Margin = new Thickness(10, 30, 0, 0);

Upvotes: 1

Martin Harris
Martin Harris

Reputation: 28637

Layer_22_copy.SetValue(Canvas.TopProperty, newTopValue);
Layer_22_copy.SetValue(Canvas.LeftProperty, newLeftValue);

Upvotes: 2

Related Questions