How do add List items to a RichTextBox?
<p>The code im trying wich is not working:</p>

<pre><code>private void clearRichtextBox()
        {
            richTextBox2.Clear();
            foreach (KeyValuePair&lt;string, List&lt;string&gt;&gt; kvp in LocalyKeyWords)
            {
                richTextBox2.AppendText("Url: " + kvp.Key + " --- " + "Localy KeyWord: " + kvp.Value);
            }

        }
</code></pre>

<p>LocalyKeyWords is a List > type of Dictionary.
Where string is the Key and List is the Value.</p>

<p><a href="http://www.google.com" rel="nofollow">http://www.google.com</a> is the Key for example and google is the value.</p>

<p>Now in this case LocalyKeywords contain 3 indexs each one have a Key and a Value.
I want after i cleared the richTextBox2 to add from the List all the Keys and Values to the richTextBox in a Format like this:</p>

<pre><code>Url: http://www.google.com --- Localy Keyword: google
Url: http://www.cnet.com --- Localy Keyword: cnet
Url: http://www.microsoft.com --- Localy Keyword: microsoft
</code></pre>

<p>But im not getting it the way i did it.</p>

<p>How can i do it ? Something wrong with the foreach i prefer to make it with FOR and not foreach.</p>

<p>The List is built as Key,Value in the text file on my hard disk fhr format is like this:</p>

<pre><code>http://www.cnet.com,cnet
</code></pre>

<p>Then in the constructor im reading it from the text file and put back the key and value into the List like this:</p>

<pre><code>private void richTextBoxLoadKeys(Dictionary&lt;string, List&lt;string&gt;&gt; dictionary, string FileName)
        {
            string line = System.String.Empty;
            using (StreamReader sr = new StreamReader(keywords))
            {
                while ((line = sr.ReadLine()) != null)
                {
                    string[] tokens = line.Split(',');
                    dictionary.Add(tokens[0], tokens.Skip(1).ToList());
                    richTextBox2.AppendText("Url: " + tokens[0] + " --- " + "Localy KeyWord: " + tokens[1]);
                }
                sr.Close();
            }
        }
</code></pre>

<p>After loading the key and values in the constructor and using a breakpoint on the List i see:</p>

<p><img src="http://i.stack.imgur.com/1JkFL.jpg" alt="enter image description here"></p>
