title: How to use dictionary in class
body: <p>How do i add items to dictionary using a textbox, i am also facing problems on linking my dictionary to a listbox since i created my dictionary in a class, how do i call <code>alphabet</code> from class to Form1</p>
  <p><em><strong>MY CLASS with the dictionary</strong></em></p>
  <pre><code>class MyCipher: ICipherDecipher
  {
      private Dictionary&lt;string, string&gt; alphabet;
  
      public MyCipher()
      {
          alphabet = new Dictionary&lt;string, string&gt;();
          alphabet.Add(&quot;4&quot;, &quot; take 4&quot;);
          alphabet.Add(&quot;3&quot;, &quot; take 3&quot;);
          alphabet.Add(&quot;5d&quot;, &quot; for 5 days&quot;);
      }
  }
  </code></pre>
  <p><em><strong>main code</strong></em></p>
  <pre><code>public partial class Form1 : Form
  {
      private ICipherDecipher myCipher;
  
      public Form1()
      {
          myCipher = new MyCipher();
          InitializeComponent();
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          string textToBeCiphered = textBox1.Text;
          string textCiphered = myCipher.Cipher(textToBeCiphered, 6);
          textBox2.Text  = textCiphered;
      }
  }
  </code></pre>
  <p>how do i call the dictionary <code>alphabet</code> from my class to main code in Form1 so that i can display it in listbox property??</p>