-3

How the form looks like currently, I want when its ran and answers are inputted, it goes to a new page titled summary, maybe.I've been trying to move information from one form to another in C# basically web form without creating a database. I want information filled on one form like maybe a simple registration form and then answers displayed on another form.

MaryJaneO
  • 1
  • 1

2 Answers2

0

If you only want the Informantion to be passed to a new form once, you may probably want this:

private string Name;
private string Password;
private string other;
public Form2 ( string _Name, string _Password, string _other ) 
{
    InitializeComponent();

    Name = _Name;
    Password = _Password;
    other = _other;
}

And to call the new Form you would need this:

Form2 frm2 = new Form2 ( NameTextbox.Text, PasswordTextbox.Text, otherTextbox.Text );
frm2.ShowDialog();

So the information and data you want to transfer would be in the parameters of public Form2 ( paramters )

Ian H.
  • 3,840
  • 4
  • 30
  • 60
  • what if I have a drop down list and a checkbox like I have shown in the picture. there has to be a code for every tool used so it can be implemented. – MaryJaneO Feb 15 '16 at 10:01
  • please see attached image @IanH – MaryJaneO Feb 15 '16 at 10:36
  • @MaryJaneO for a listbox store the "selectedIndex" in an integer and for the check box the "checked" property as a boolean – Ian H. Feb 15 '16 at 11:41
0

from your attached image, I'm assuming that you are making some web application or website, and as per your requirement I would suggest you to use query string

follow the link

for checkboxes you can use Booleans and for dropdown list's selection you can simply use strings

Community
  • 1
  • 1
Amit
  • 1,821
  • 1
  • 17
  • 30