Getting values from method from other form
<p>I'm having a problem where I retrieve a value in a method in a different form to my main form.</p>

<p>Here is my code:
(This is the main form where i want to retrieve the value.)</p>

<pre><code>private void EstimationComp_Click(object sender, EventArgs e)
{
    PaintingFender pff = new PaintingFender();
    textBox8.Text = panels;
    textBox30.Text = amounts;
    panels = pff.panel();
    descr = pff.desc();
    status = pff.stats();
    amounts = pff.amount();
    dtg.RowCount = 5;
    dtg[0, 0].Value = panels;
    dtg[1, 0].Value = descr;
    dtg[2, 0].Value = status;
    dtg[3, 0].Value = amounts;
}
</code></pre>

<p>This is the form where I declared the method in which I want to retrieve the value from the add button when a radiobutton is selected:</p>

<pre><code>public string panel()
{
    return p;
}

public string desc()
{
    return d;
}
public string stats()
{
    return s;
}
public string amount()
{
    return a;
}

private void TADD_bump_Click(object sender, EventArgs e)
{
    try
    {
        if ((conn == null) || (conn.State != ConnectionState.Open))
        {
            MessageBox.Show("unable to connect to database", "error");
            return;
        }
        else
        {
            OleDbCommand cmd = new OleDbCommand("select * from p_painting");
            cmd.CommandType = CommandType.Text;
            cmd.Connection = conn;
            da = new OleDbDataAdapter(cmd);
            ds = new DataSet("ds");
            da.Fill(ds);
            ds.Tables[0].TableName = "table_mirror";
            dtg.DataSource = ds.Tables["table_mirror"];
        }
    }
    catch (Exception x)
    {
        MessageBox.Show(x.Message);
    }

    if (frontbumper.Checked == true)
    {
        status();
        d = frontbumper.Text;
        a = textBox2.Text;
        p = "Fender";
        if (bump_light.Checked == true)
        {
            s = "Light Repair";
        }
        if (bump_moderate.Checked == true)
        {
            s = "Moderate Repair";
        }
        if (bump_heavy.Checked == true)
        {
            s = "Heavy Repair";
        }
        if (bump_replacement.Checked == true)
        {
            s = "Replacement";
        }
    }
</code></pre>

<p>I traced the method and I think it does not get the value from the button when it is clicked because from the beginning of the program the method is already performed. I want to perform the method only when the button is clicked so that I can retrieve the value from the TADD button to be passed the string values in my main form namely estimationcomp.</p>
