on selecting an item in listbox disable a button
<p>On selecting the firstitem in the list box my Up button should be disabled. similarly on selecting the Lastitem in the listbox Down button should be disabled. I can able to find which item is selected by using selected index</p>

<pre><code>if (lstview.SelectedIndex &gt;= 0)
  {
     var selectedItems = lstview.SelectedItems;
     foreach (ClassName selectedItem in selectedItems)
       {
         lstview.Items.Remove(selectedItem);
         break;
       }            
   }
</code></pre>

<p>but how to disable the up and down button based on selecting first item or last item in the list box</p>
