| | |
Using multiple forms in c# windows application
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Thread Solved
![]() |
You mean MDI? or just you need to open Form2 from Form1 and use some values in Form1 user entered in Form2??
For second case, just create another Form let say it called Form2, some public members (TextBox, ListBox, etc...)
Add this code in Form1 to open Form2
Get the value of form2's textbox
For second case, just create another Form let say it called Form2, some public members (TextBox, ListBox, etc...)
Add this code in Form1 to open Form2
c# Syntax (Toggle Plain Text)
Form2 form2 = new Form2(); fom2.ShowDialog();//enforces user to not back to form1 unless finishing work on form2
Get the value of form2's textbox
c# Syntax (Toggle Plain Text)
string str = form2.textbox2.Text;
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
•
•
Join Date: Sep 2008
Posts: 1
Reputation:
Solved Threads: 0
I get this:
It tells me that "Mail.Form3.textBox1 Is inaccesable due to its pro tsction level."
PLEASE HELP!!!
private void button2_Click(object sender, EventArgs e)
{
Form3 form3 = new Form3(); form3.ShowDialog();
string str = Form3.textBox1.Text;
}PLEASE HELP!!!
•
•
Join Date: Mar 2008
Posts: 6
Reputation:
Solved Threads: 0
•
•
•
•
I get this:
It tells me that "Mail.Form3.textBox1 Is inaccesable due to its pro tsction level."private void button2_Click(object sender, EventArgs e) { Form3 form3 = new Form3(); form3.ShowDialog(); string str = Form3.textBox1.Text; }
PLEASE HELP!!!
![]() |
Similar Threads
- Open Same forminstance Multiple times (C++)
- memory management in wndows 2000 (Windows NT / 2000 / XP)
- HOWTO: Share an SQL Connection between multiple forms within the same project (C#)
- P2P based chat (C#)
Other Threads in the C# Forum
- Previous Thread: Stupid Question
- Next Thread: XML attributes to Combobox
| Thread Tools | Search this Thread |
.net access algorithm animation array asp avltree bitmap box c# check checkbox client column combobox control conversion csharp database datagrid datagridview datagridviewcheckbox dataset datetime degrees directrobot display draganddrop drawing encryption enum excel file form format formatting formbox forms formupdate function gdi+ hash image input install java label leak linux list math mouseclick mp3 mysql namevaluepairs native networking operator packaging path photoshop picturebox pixelinversion post powerpacks print process programming radians regex remoting reporting richtextbox robot safari server sleep snooze socket sql statistics string table tables tcp text textbox thread time timer update usercontrol usercontrols validation visualstudio webbrowser wfa winforms wpf xml






