The good news is I'm to the very last part of this project, the bad news is i can't figure it out. My program consist of two forms. The first form is only relevant at this moment because it is where I originally load the text file into a dictionary. 

```
class SharedMethods
{
    public static void LoadDictionary(Dictionary<string, string> vendorPhones)
    {
        string currentLine;
        string[] fields = new string[2];
        StreamReader vendorReader = new StreamReader("Vendor.txt");

        while (vendorReader.EndOfStream == false)
        {
            currentLine = vendorReader.ReadLine();
            fields = currentLine.Split(',');

            vendorPhones.Add(fields[1], fields[6]);
            string[] name = { fields[1] };
            string[] phone = { fields[6] };
        }
        vendorReader.Close();
    }
}

```

Now the second form is what is important. This form is opened from the first form and allows the user to select a name from a combobox, and the phone number that belongs to that name is displayed in a text box. The user can then type in the text box to overwrite that name and click save to save it to a text file. My problem is I can't figure out how to get the writing function to find the selected name in the text and then write over the current phone element in that row. Here is my code for this form:

```
public partial class UpdateVendor : Form
{
    public UpdateVendor()
    {
        InitializeComponent();
    }

    public Dictionary<string, string> vendorPhones = new Dictionary<string, string>();

    private void UpdateVendor_Load(object sender, EventArgs e)
    {
        SharedMethods.LoadDictionary(vendorPhones);
        foreach (string name in vendorPhones.Keys)
        {
            cboVendors.Items.Add(name);
        }
    }

    private void cboVendors_SelectedIndexChanged(object sender, EventArgs e)
    {          
        string selectedName = cboVendors.SelectedItem.ToString();
        string phone = vendorPhones[selectedName];
        txtPhone.Text = phone.ToString();
    }

    private void btnSave_Click(object sender, EventArgs e)
    {
        //SharedMethods.LoadDictionary(vendorPhones);
        //string selectedName = cboVendors.SelectedItem.ToString();
        //string newPhone;
        //newPhone = txtPhone.Text;

        //using (var sw = new StreamWriter("Vendors.txt"))
        //{

        //}
        // I've tried a lot of things but can't get any to work. 

    }

```

Sorry if the code makes you cringe in disgust. I'm just learning code and I'm ecstatic that it works half the time. 

To add, here is how the program looks when running: 
[Second form running](https://i.stack.imgur.com/L3pbq.png)