簡體   English   中英

WP7 Silverlight:如何向WrapPanel的邊框添加兩個按鈕

[英]WP7 Silverlight: How do I add two Button to a Border of a WrapPanel

對於日歷應用程序(silverlight WP7.5),我使用wrappanel包含日期(以Button為子元素的邊框)。 現在,我想在邊框內添加另一個按鈕。 因此,每天都會有編號和其他信息/圖形。 只是注意到Border只能包含1個孩子。 我該怎么辦?

Border border = new Border();
Button btn = new Button();
border.Child = btn;
//Button btn_notification = new Button();
// how to add the btn_notification????
CalendarWrapPanel.Children.Add(border);

非常感謝你!

只需在邊框內添加另一個容器(網格,堆棧面板...)。 本示例使用StackPanel對其進行演示:

Border border = new Border();
Button btn = new Button();
Button btn_notification = new Button();
StackPanel panel = new StackPanel();
panel.Children.Add(btn);
panel.Children.Add(btn_notification);
border.Child = panel;
CalendarWrapPanel.Children.Add(border);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM