1
我想動態創建列表框[codebehind c#]。它的數據源是類對象。如何動態創建列表框wpf
class sample
{
string filepath;
string id;
string trackName;
}
需求:
- 顯示TRACKNAME如在列表框[動態]列表框項目。
代碼:
sample samp=GetBL.GetValue();
ListBox lbTrack = new ListBox();
StackPanel sp = new StackPanel();
lbTrack.ItemSource = samp;
格塔。