당신은 당신의 스레드 상태에 대한 관찰 모음을 만드는 시도 할 수 있습니다. 그런 다음 목록 상자를이 컬렉션에 바인딩합니다.
는 편집 :
// Define a data context
public class MyContext
{
public ObservableCollection<string> Values { get; set; }
}
당신은 XAML에서 다음하지만 내 WPF 조금 녹슨 할 수 있습니다. 나는 이것을 폼로드에 넣는다.
// Create an instance of your context
var myContext = new MyContext();
myContext.Values = new ObservableCollection<string>();
// Set up a binding between your collection and the 'Items' property of the listbox
Binding b = new Binding();
b.Source = myContext;
b.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
b.Path = new PropertyPath("Values");
ListBox1.SetBinding(ListBox.ItemsSourceProperty, b);
// Add values to the collection - these will automatically end up in the listbox
myContext.Values.Add("New item");
myContext.Values.Add("Other new item");
// You can change values too
myContext.Values[0] = "This has changed";
나는 예를 들어,와 같은 일을 시도 할 것입니다.,를 RichTextBox 확실히 제가하여 RichTextBox를 확인하고 내가이 라인을 기반으로 만들기 위해 어떤 방법을 볼 수 없습니다 –
있는지 여부를 확인 할 수 있습니다. 나는 listbox에서 스레드를 따라갈 수 있도록 항상 동일한 라인을 편집 중이다. 그러나 richtextbox 나는 그것을 어떻게해서든지 보지 못한다. – MonsterMMORPG
을 해보자 목록 상자 문제 – MonsterMMORPG