What am I doing wrong and how can I do it better

Nothing is being sent over. It just sends a "".
private void newToolStripMenuItem_Click(object sender, EventArgs e)
            DialogResult result = new New().ShowDialog();
            New newForm = new New();
            Person person = new Person();
            switch (result)
                case DialogResult.Abort:
                    break;
                case DialogResult.Cancel:
                    quit = true;
                    break;
                case DialogResult.Ignore:
                    break;
                case DialogResult.No:
                    break;
                case DialogResult.None:
                    break;
                case DialogResult.OK:
                    person.forename = newForm.Forname;
                    person.surname = newForm.Surname;
                    person.dateJoined = newForm.DateJoined;
                    utilities.neutralList.Add(person.FullName);
                    RefreshList();
                    break;
                case DialogResult.Retry:
                    break;
                case DialogResult.Yes:
                    break;
                default:
                    break;
        private void RefreshList()
            foreach (var item in utilities.neutralList)
                listBox2.Items.Add(item);
        }

It looks like you are trying to retrieve data from 2nd form.  You are not returning any value from the 2nd form.  See two form project below.  I have a helper method GetData.
Form 1
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
public partial class Form1 : Form
Form2 form2;
public Form1()
InitializeComponent();
form2 = new Form2(this);
private void button1_Click(object sender, EventArgs e)
form2.Show();
string results = form2.GetData();
Form 2
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
public partial class Form2 : Form
Form1 form1;
public Form2(Form1 nform1)
InitializeComponent();
this.FormClosing += new FormClosingEventHandler(Form2_FormClosing);
form1 = nform1;
form1.Hide();
private void Form2_FormClosing(object sender, FormClosingEventArgs e)
//stops for from closing
e.Cancel = true;
this.Hide();
public string GetData()
return "The quick brown fox jumped over the lazy dog";
jdweng

Similar Messages

Maybe you are looking for

  • Problem  while creating  contact person using SD_CUSTOMER_MAINTAIN_ALL

    Hi All, I am trying to create a contact person to a customer using FM SD_CUSTOMER_MAINTAIN_ALL.Following is the simple code that I am using.FM is not giving any exception.But the contact person is not getting created.can anyone help me regarding this

  • ARD, screen share and a second monitor

    I have a 2008 20 inch iMac and 13" aluminium macbook. I wanted to use the iMacs screen with my macbook and decided to get ard (as it was kind of cheap on the app store). I was a bit disheartened when I found that, when controlling the macbbok from th

  • Invoking system's default browser

    Hi While developing a swing application, in event handling, I would like to open a HTML file in the system's default browser like IE or netscape. Can I know how to do that?

  • Join to multiple sql db's

    I have one table (user_projects) that lists user_id and project_id, a user table to get the user name and a project table to get the project name. These items are all contained in a single 'admin' database. Each individual project has a separate data

  • What can be done in Java?

    I wonder what is relistic to do in java? Im thinking mainly in terms of games... As I understand it, Java aplications are not the fastest due to the "runtime translation" the JVC does... (hope I've got that right, otherwise: please correct me!) By st