2011-09-30 62 views
0

如何在Windows Phone 7中使用android樣式引力,並且gavityTop = 20px,Left = 30px?Windows Phone 7 Button Left-Top from Code

 Button btn = new Button() { 
      Content="newbutton "+i, 
      Margin=new Thickness(20) 
     }; 

ID喜歡的事,從頂部控制我的按鈕的左/頂邊距/左

回答

1

如果我理解你的權利,你想是這樣的:

HorizontalAlignment = HoriztontalAlignment.Left, 
VerticalAlignment = VerticalAlignment.Top, 
Margin = new Thickness(30,20,0,0),//left 30, top 20, right 0, bottom 0 

PS:未經檢驗的,可能包括錯別字。在此PC上沒有SDK