Home > DeveloperSection > Blogs > SortedList in C#

SortedList in C#


C# C# 
Ratings:
0 Comment(s)
 1765  View(s)
Rate this:
Use of SortedList

SortedList
sl = new SortedList();
//creating sorted list.
private voidbtnAdd_Click(object sender, EventArgs e)
{

if(txtValue.Text != "" &&txtKey.Text != "")
      {
            sl.Add(txtKey.Text, txtValue.Text);

//adding key and value to sortedlist.
            txtKey.Text= "";
           txtValue.Text = "";
      }
      else
            MessageBox.Show("Text Box Empty");
}

Don't want to miss updates? Please click the below button!

Follow MindStick