Click here to Skip to main content
14,667,169 members
Rate this:
Please Sign up or sign in to vote.
See more:
i use this code to set the control location in win form :
TextBox1.Location = new Point (100,100);

what is this code equivalent in c# wpf ?
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

For Location, WPF uses Margin.
So use the following code to set the location.

button1.Margin = new Thickness(10, 10, 0, 0);

For more info on alignment and margins:
http://msdn.microsoft.com/en-us/library/ms751709.aspx[^]
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100