title: How do I make this display in my textbox?
body: <p>I am trying to make the result display in my text box. For a regular windows console the code would work, but how do I do it with a GUI? </p>
  
  <p>The whole <code>Console.WriteLine</code> part of the code has a red underline.</p>
  
  <pre><code>var listOfWords = Regex.Matches(File.ReadAllText(textBoxInputFile.Text), @"\w+")
                         .Cast&lt;Match&gt;()
                         .Select((m, pos) =&gt; new { Word = m.Value, Pos = pos })
                         .GroupBy(s =&gt; s.Word, StringComparer.CurrentCultureIgnoreCase)
                         .Select(g =&gt; new { Word = g.Key, PosInText = g.Select(z =&gt; z.Pos).ToList() })
                         .ToList();
  
  
  var result = listOfWords.GroupBy(x =&gt; x)
                           .Select(x =&gt; new { Key = x.Key, Count = x.Count() })
                           .OrderBy(x =&gt; x.Key);
  
  result.ToList().ForEach(x =&gt;
  {
      textBoxShowText.Text = Console.WriteLine("{0}:{1}", x.Key, x.Count);
  });
  </code></pre>