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.
Asked
Active
Viewed 72 times
-3
-
Do you want to transfer it only when the new form is shown or afterwards aswell? – Ian H. Feb 15 '16 at 09:15
-
I just want it shown on a new form not afterwords, you know when the user probably fills the information, and submits it automatically goes to the next form showing the answers. @IanH. – MaryJaneO Feb 15 '16 at 09:21
-
please show some code, some example... what you try, where you stop ? – Aristos Feb 15 '16 at 09:22
-
@Aristos I just added a picture. – MaryJaneO Feb 15 '16 at 10:01
2 Answers
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
-
-
@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