abrim
Messages postés16Date d'inscriptionlundi 27 avril 2009StatutMembreDernière intervention 2 juin 2011
-
23 févr. 2011 à 12:18
NightlyDev
Messages postés26Date d'inscriptionjeudi 24 février 2011StatutMembreDernière intervention 6 mars 2011
-
25 févr. 2011 à 11:28
Bonjour à tous ,
J'ai un fichier app.xaml danslaqu'elle j'ai un textbox nommé mytextbox , et j'ai un autre fichier tools.cs en c# , je veu utiliser mytextbox dans tools.cs alors comment je peu définir cet variable qui est cré dans app.xaml
prière aidez moi
Cordialement
NightlyDev
Messages postés26Date d'inscriptionjeudi 24 février 2011StatutMembreDernière intervention 6 mars 2011 25 févr. 2011 à 11:28
Je ne connais pas bien XAML.
Cependant, si c'est comme en WindowsForm, tu peux créer une fonction (void) dans tools.cs qui récupère le contenu de la textbox.
Petit exemple :
[tools.cs]
public void GetTextBox(string text)
{
string mytext = text; //Ici, on recupere le contenu de ta textbox...
}
[app.xaml]
Tools mytools = new Tools(); //En remplacant Tools par le nom de la class.
mytools.GetTextBox(textBox1.Text);