I am still new to C#, but I have written a progam that is significant to my work, I design custom pivot irrigation for farms. I have written the program to allow me to put in the span length and pipe diameters etc. and them at the click of a button I get all the flows and fiction loss and Pipe pressures etc. as I said I am still new to C# so I do a screen dump to print it, (until I work out how to produce a nice layout through xml and html or excel. (I'm working on that))

I have the client information on another form though. and I need to transfer this detail to the form with all the pivot details on it.
these details are Client name,area,number, sales person (combobox) and date(date time picker)

I have googled and wandered the forums trying to find a way to transfer all this data and I have tried a number of ways but to no avail. I have the methos that Ruelk used but I still can't get that to work.

Can anyone help me achieve that which I seek.

Thanks

basic concept could be to create a class that holds your values

//I would recommend private, with getters and setters, just using this for the concept
public class PivotDetails
{
  public string clientName;
  public string area;
  public string number;
public string salesPerson;
public Date salesDate;
}

in your pivot details form you can do something like this
create controls for all your fields, i will reference them using "this"

public void SetPageValues(PivotDetails details)
{
this.tbClientName.Text = details.clientName;
this.tbArea.Text = details.area;
///....continue with the rest
}

from your calling form you create the class and pass it to the other form

//from client form
PivotDetails details = new PivotDetails();
details.clientName = this.clientName.Text;
//same for the rest

//now we'll call the pivotdetails form
frmPivotDetails frmPD = new frmPivotDetails();

//call our method to update it
frmPD.SetPageValues(details);

//show the form
frmPD.Show();

Thank you very much.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.