Hi I am creating a simple windows forms app to for an assignment to register staff in a hospital and display it on a data grid, I don't know how to move the list that gets created to another form, any suggestions? here is the code for one of them and the interface. the first form is the button to open different roles and below it the data grid box with a button above to make it display the data.
public partial class formDoctor : Form
{
public formDoctor()
{
InitializeComponent();
}
ListViewDoctor lvDoc = new ListViewDoctor();
private void formDoctor_Load(object sender, EventArgs e)
{
cboCountyDoctor.DataSource = Enum.GetValues(typeof(Counties));
}
private void btnSubmitDoctor_Click(object sender, EventArgs e)
{
string fn, sn, ads, cy, age, pn, mail,hol;
fn = txtFnDoctor.Text;
sn = txtSnDoctor.Text;
ads = txtAddressDoctor.Text;
cy = cboCountyDoctor.SelectedItem.ToString();
age = txtAgeDoctor.Text;
pn = txtPhoneDoctor.Text;
mail = txtEmailDoctor.Text;
hol = "Lung";
if (cbHeartDoc.Checked)
{
hol = "Heart";
}
lvDoc.AddToListDoctor(fn, sn, ads, cy, age, pn, mail,hol);
txtFnDoctor.Clear();
txtSnDoctor.Clear();
txtAddressDoctor.Clear();
txtAgeDoctor.Clear();
txtPhoneDoctor.Clear();
txtEmailDoctor.Clear();
}
}
}