IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

C++/CLI Discussion :

Comment Trouver un tableau comme avec Control->Find


Sujet :

C++/CLI

Vue hybride

TrollTop Comment Trouver un tableau... 24/03/2009, 18h21
Médinoc Ton tableau est-il un... 24/03/2009, 18h23
TrollTop non c'est des tableaux... 24/03/2009, 23h33
Médinoc Si ces tableaux ne sont pas... 25/03/2009, 09h04
TrollTop Comment tu fais pour les... 25/03/2009, 12h14
Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Inscrit en
    Juillet 2007
    Messages
    124
    Détails du profil
    Informations forums :
    Inscription : Juillet 2007
    Messages : 124
    Par défaut Comment Trouver un tableau comme avec Control->Find
    Bonjours,


    Je cherche à trouver un tableau comme avec Control->Find est-ce possible.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    array<Control ^> ^labelATrouverHeure = Controls->Find(String::Format("label{0}",i), true);
    Merci d'avance.

    TrollTop

  2. #2
    Expert éminent
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 395
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 395
    Par défaut
    Ton tableau est-il un contrôle?
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  3. #3
    Membre confirmé
    Inscrit en
    Juillet 2007
    Messages
    124
    Détails du profil
    Informations forums :
    Inscription : Juillet 2007
    Messages : 124
    Par défaut
    non c'est des tableaux déclarer

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    private:static array<String ^,2> ^TableauContainer1 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauContainer2 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauContainer3 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauContainer4 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauContainer5 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauContainer6 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauContainer7 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauPorte1 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauPorte2 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauPorte3 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauPorte4 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauPorte5 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauPorte6 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauPorte7 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauPorte8 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauPorte9 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauPorte10 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauPorte11 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauPorte12 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauPorte13 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauPorte14 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauPorte15 = gcnew array<String ^,2> (4,1000);
    private:static array<String ^,2> ^TableauPorte16 = gcnew array<String ^,2> (4,1000);
    On peut faire des tableaux comme un Control ex TextBox ou Label

    Merci pour ton aide

    TrollTop

  4. #4
    Expert éminent
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 395
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 395
    Par défaut
    Si ces tableaux ne sont pas dans la liste Controls, tu ne peux pas les avoir avec Controls.Find.

    Par contre, tu peux toujours te faire un dictionnaire de tableaux de strings à deux dimensions...

    PS: Pourquoi sont-ils déclarés static?
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  5. #5
    Membre confirmé
    Inscrit en
    Juillet 2007
    Messages
    124
    Détails du profil
    Informations forums :
    Inscription : Juillet 2007
    Messages : 124
    Par défaut
    Comment tu fais pour les mettre dans la liste de control ou bien faire un dictionnaire ?

    Merci

    TrollTop

  6. #6
    Expert éminent
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 395
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 395
    Par défaut
    Code C++/CLI : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    Dictionary< String^, array<String^, 2>^ >^ dico = gcnew Dictionary< String^, array<String^, 2>^ >();
    dico->Add(L"TableauContainer1", gcnew array<String^, 2> (4,1000));
    dico->Add(L"TableauContainer2", gcnew array<String^, 2> (4,1000));
    ...
    Et tu peux même t'en faire une boucle for:
    Code C++/CLI : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    Dictionary< String^, array<String^, 2>^ >^ dico = gcnew Dictionary< String^, array<String^, 2>^ >();
    for(int i=1 ; i<=7 ; i++)
    	dico->Add(String::Format(L"TableauContainer{0}", i), gcnew array<String^, 2> (4,1000));
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 3
    Dernier message: 29/04/2007, 17h17
  2. Réponses: 1
    Dernier message: 29/04/2006, 16h55
  3. [Tableaux] Trier un tableau comme avec ORDER BY DESC
    Par Anduriel dans le forum Langage
    Réponses: 28
    Dernier message: 08/12/2005, 18h50
  4. Comment créer des onglets comme avec Excel (sheet1/sheet2)
    Par pierrot10 dans le forum Général JavaScript
    Réponses: 1
    Dernier message: 20/09/2005, 16h36

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo