title: How can i give a focus to a listBox in the constructor and when a new item was added?
body: <p>In the constructor i did:</p>
  
  <pre><code>if (listBox1.Items != null)
              {
                  listBox1.Focus();
              }
  </code></pre>
  
  <p>But when im running the program i cant move with the keyboards up down in listBox since the focus is on a button somewhere else in the Form. I need to click with the mouse on the listBox to get the focus.</p>
  
  <p>Another problem i want that when the user add a new item to the listBox the focus will be automatic on the last added item. For this problem this is the code where im adding a new item to the listBox:</p>
  
  <pre><code>private void KeysValuesUpdate()
          {
              using (var w = new StreamWriter(keywords_path_file))
              {
                  crawlLocaly1 = new CrawlLocaly();
                  crawlLocaly1.StartPosition = FormStartPosition.CenterParent;
                  DialogResult dr = crawlLocaly1.ShowDialog(this);
                  if (dr == DialogResult.OK)
                  {
                      if (LocalyKeyWords.ContainsKey(mainUrl))
                      {
                          LocalyKeyWords[mainUrl].Clear();
                          LocalyKeyWords[mainUrl].Add(crawlLocaly1.getText());
                      }
                      else
                      {
                          LocalyKeyWords[mainUrl] = new List&lt;string&gt;();
                          LocalyKeyWords[mainUrl].Add(crawlLocaly1.getText());
                      }
                      Write(w);
                      ClearListBox();
                  }
                  if (dr == DialogResult.Cancel)
                  {
                      Write(w);
                  }
              }
          }
  
          private void ClearListBox()
          {
              data.Clear();
              listBox1.DataSource = null;
              string sb;
              foreach (KeyValuePair&lt;string, List&lt;string&gt;&gt; kvp in LocalyKeyWords)
              {
                  for (int i = 0; i &lt; kvp.Value.Count(); i++)
                  {
                      sb = "Url: " + kvp.Key + " --- " + "Local KeyWord: " + kvp.Value[i] + Environment.NewLine;
                      data.Add(sb.ToString());
                  }
              }
              listBox1.DataSource = data;
          }
  </code></pre>
  
  <p>The question is why i cant set the focus in any of the cases on the listBox items ?</p>
  
  <p>In the first case in the constructor the focus i want it to be on the last item in the list and also each time im adding a new item so the focus will be on the last added item.</p>