title: Changing value of textbox according to the selected combobox value
body: <p>I have tried the below code to get selected value of combo-box to textbox but it give me the following error</p>
  
  <p>Error : Object reference not set to an instance of an object.</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>private void frmpaymentsearch_Load(object sender, EventArgs e)
  {
      txtcomvalue.Text = "PaymentVoucherCode";
      dllby.DisplayMember = "Text";
      dllby.ValueMember = "Value";
      dllby.Items.Add(new { Text = "P.Voucher Code", Value = "PaymentVoucherCode" });
      dllby.Items.Add(new { Text = "Vendor", Value = "VendorName" });
      dllby.SelectedIndex = 0;
  }
  
  
  
  private void dllby_SelectedIndexChanged(object sender, EventArgs e)
  {
      txtcomvalue.Text = dllby.SelectedValue.ToString();
  }
  </code></pre>