Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I pass parameters from Form1 to Form2?
Message
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00697863
Message ID:
00697904
Views:
15
>If I try to access an objects value on Form1 from Form2 quoting the namespace, I get the error:
>
>'.FormMain.txtChartNo.Text' is inaccessible due to its protection level.

You can define Construtor to receive the parameters when Form object is created. For example,

public Class myForm : System.Windows.Forms.Form
{
protected string cMyProperty;
public myForm(string tcMyPara)
{
cMyProperty = tcMyPara
}
}

Here is how you call myForm from Form1 with parameter.

myForm loForm = new myForm("ParameterValue");
loForm.Show();

PS: Please execuse syntax errors in above examples...
- Jayesh
Previous
Reply
Map
View

Click here to load this message in the networking platform