public MainWindow() { InitializeComponent(); this.fooTextBox.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(fooTextBox_MouseDoubleClick); this.fooTextBox.ShowTab = true; this.fooTextBox.ShowHalfSpace = true; this.fooTextBox.ShowFullSpace = true; this.fooTextBox.ShowLineBreak = true; var complete_collection = new CompleteCollection <ICompleteItem>(); complete_collection.Add(new CompleteWord("int")); complete_collection.Add(new CompleteWord("float")); complete_collection.Add(new CompleteWord("double")); complete_collection.Add(new CompleteWord("byte")); complete_collection.Add(new CompleteWord("char")); complete_collection.Add(new CompleteWord("var")); Document doc = this.fooTextBox.Document; doc.AutoComplete = new AutoCompleteBox(doc); doc.AutoComplete.Items = complete_collection; doc.AutoComplete.Enabled = true; doc.LayoutLines.FoldingStrategy = new CharFoldingMethod('{', '}'); //doc.LayoutLines.FoldingStrategy = new WZTextFoldingGenerator(); doc.Update += Document_Update; this.Closed += MainWindow_Closed; }
public Form1() { InitializeComponent(); this.fooTextBox1.ShowTab = true; this.fooTextBox1.ShowFullSpace = true; this.fooTextBox1.ShowLineBreak = true; var collection = new CompleteCollection <ICompleteItem>(); collection.Add(new CompleteWord("int")); collection.Add(new CompleteWord("float")); collection.Add(new CompleteWord("double")); collection.Add(new CompleteWord("byte")); collection.Add(new CompleteWord("char")); this.fooTextBox1.Document.AutoComplete.Items = collection; this.fooTextBox1.Document.AutoComplete.Enabled = true; }