2017-05-18 71 views

回答

0

處理的Populated事件:

private void AutoCompleteBox_Populated(object sender, PopulatedEventArgs e) 
{ 
    int count = 0; 
    foreach (var item in e.Data) 
     count++; 

    string text = count + " items shown!"; 
} 
+0

謝謝!很棒! – Siitanonchay

2

或者你甚至可以只是這樣做,避免循環:

private void AutoCompleteBox_Populated(object sender, PopulatedEventArgs e) 
{ 
    int count = ((ReadOnlyCollection<object>)e.Data).Count; 
} 
相關問題