Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I pass parameters from Form1 to Form2?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00697863
Message ID:
00697904
Vues:
16
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform