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

MFC Discussion :

3 Zone de Liste en cascade et Fenêtre de lancement VC++ 6


Sujet :

MFC

  1. #1
    Membre du Club
    Homme Profil pro
    Ingénieur développement matériel électronique
    Inscrit en
    Mars 2006
    Messages
    71
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Ingénieur développement matériel électronique

    Informations forums :
    Inscription : Mars 2006
    Messages : 71
    Points : 63
    Points
    63
    Par défaut 3 Zone de Liste en cascade et Fenêtre de lancement VC++ 6
    Désolé c'est un peu long à lire, j'ai une fenêtre nommé PR qui contient 3 listbox (1,2,3) et Deux boutons ok et Annuler, je souhaite que lorsque je clique sur mécanique l'application affiche dans le listbox 2 "10 Moteur"....

    variables membres classe CPR:

    Cstring m_strList1
    CListBox m_ctlList1
    Cstring m_strList2
    CListBox m_ctlList2
    Cstring m_strList3
    CListBox m_ctlList3

    Le code ci dessous fonctionne mais j'affiche en cliquant sur mécanique à la fois la mécanique, la carrosserie, la sellerie. dans la listbox 2

    La dexiéme question: Comment afficher une fenêtre avant le lancement de l'application pendant quelque secondes comme lorque l'on lance Adobe Acrobat par exemple.


    Merci par avance pour Aide

    Chris

    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
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    BOOL CPR::OnInitDialog() 
    {
    	CListBox* pLB = (CListBox*)GetDlgItem(IDC_LISTPR1);
    	pLB->InsertString(-1,"Mécanique");
    	pLB->InsertString(-1,"Carrosserie");
    	pLB->InsertString(-1,"Sellerie et Electricité");
     
    	return CDialog::OnInitDialog();
    	              // EXCEPTION: OCX Property Pages should return FALSE
    }
     
    void CPR::OnSelchangeListpr1() 
    {
    	if(m_strList1="Mécanique")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR2);
    		pLBm->InsertString(-1,"10 Moteur");
    		pLBm->InsertString(-1,"11 Haut moteur");
    		pLBm->InsertString(-1,"12 Carburation");
    		pLBm->InsertString(-1,"13 Alimentation");
    		pLBm->InsertString(-1,"14 Antipollution");
    		pLBm->InsertString(-1,"16 Démarrage Charge");
    		pLBm->InsertString(-1,"17 Allumage");
    		pLBm->InsertString(-1,"19 Refroidissement -  Reservoirs -  Echappement - Support moteur");
    		pLBm->InsertString(-1,"20 Embrayage");
    		pLBm->InsertString(-1,"21 Boite de vitesses  mécanique");
    		pLBm->InsertString(-1,"29 Transmission");
    		pLBm->InsertString(-1,"31 Elements porteurs avant");
    		pLBm->InsertString(-1,"32 Elements non porteurs avant");
    		pLBm->InsertString(-1,"33 Elements porteurs arriere");
    		pLBm->InsertString(-1,"34 Element non porteurs arriere");
    		pLBm->InsertString(-1,"35 Roues Pneumatiques");
    		pLBm->InsertString(-1,"36 Direction");
    		pLBm->InsertString(-1,"37 Commandes aux pieds");
    		pLBm->InsertString(-1,"38 Commandes à main");
    		pLBm->InsertString(-1,"90 Cric Petites fournitures");
    	}
    	if(m_strList1="Carrosserie")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR2);
    		pLBm->InsertString(-1,"40 Gros units carrosserie");
    		pLBm->InsertString(-1,"41 Units inférieurs");
    		pLBm->InsertString(-1,"42 Units intérieurs avant");
    		pLBm->InsertString(-1,"43 Units latéraux fixes");
    		pLBm->InsertString(-1,"44 Units intérieurs arrière");
    		pLBm->InsertString(-1,"45 Units supérieurs");
    		pLBm->InsertString(-1,"46 Ailes et carters protection");
    		pLBm->InsertString(-1,"47 Ouvrant latéraux");
    		pLBm->InsertString(-1,"48 Ouvrant non latéraux");
    		pLBm->InsertString(-1,"50 Mécanismes");
    		pLBm->InsertString(-1,"52 Equilibreurs de porte hayon ou coffre");
    		pLBm->InsertString(-1,"53 Barillet de serrure");
    		pLBm->InsertString(-1,"54 Vitres");
    		pLBm->InsertString(-1,"55 Protection - Enjoliveurs extérieurs");
    		pLBm->InsertString(-1,"56 Accessoires extérieurs divers");
    	}	
    }
     
    void CPR::OnSelchangeListpr2() 
    {
    	if(m_strList2="10Moteur")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Moteur complet");
    		pLBm->InsertString(-1,"02Joints moteur");
    		pLBm->InsertString(-1,"03Chemises pistons");
    		pLBm->InsertString(-1,"04Coussinets - Paliers");
    		pLBm->InsertString(-1,"05Carter cylindres");
    		pLBm->InsertString(-1,"06Carter d'huile");
    		pLBm->InsertString(-1,"07Vilebrequin");
    		pLBm->InsertString(-1,"08Pompe a huile");
    		pLBm->InsertString(-1,"09Filtre a huile");
    	}
    	if(m_strList2="11Haut moteur")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Distribution");
    		pLBm->InsertString(-1,"02Pompe a eau");
    		pLBm->InsertString(-1,"03Cache culbuteurs -  Culasse");
    	}
    	if(m_strList2="12Carburation")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Collecteur");
    		pLBm->InsertString(-1,"02Carburateur");
    		pLBm->InsertString(-1,"03Rechauffage - Refroidissement huile ou carburant");
    		pLBm->InsertString(-1,"04Refroidissement carburateur");
    	}
    	if(m_strList2="13Alimentation")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Pompe a essence");
    		pLBm->InsertString(-1,"02Filtre a air");
    		pLBm->InsertString(-1,"03Tuyauterie filtre à air");
    		pLBm->InsertString(-1,"04Turbo");
    	}
    	if(m_strList2="14Antipollution")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Antipollution");
    	}
    	if(m_strList2="16Démarrage Charge")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Alternateur - Demarreur");
    	}
    	if(m_strList2="17Allumage")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Allumeur");
    		pLBm->InsertString(-1,"02Bobine d'allumage");
    		pLBm->InsertString(-1,"03Bougies");
    	}
    	if(m_strList2="19Refroidissement -  Reservoirs -  Echappement - Support moteur")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Radiateur d'eau");
    		pLBm->InsertString(-1,"02Tuyauterie radiateur");
    		pLBm->InsertString(-1,"03Reservoir carburant");
    		pLBm->InsertString(-1,"04Echappement");
    		pLBm->InsertString(-1,"05Support moteur");
    	}
    	if(m_strList2="20Embrayage")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Embrayage");
    	}
    	if(m_strList2="21Boite de vitesses  mécanique")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Boite de vitesses mecanique");
    		pLBm->InsertString(-1,"02Carters de boite de vitesses");
    		pLBm->InsertString(-1,"03Pignons de boite de vitesses");
    		pLBm->InsertString(-1,"04Differentiel");
    		pLBm->InsertString(-1,"05Fourchette de boite de vitesses");
    	}
    	if(m_strList2="29Transmission")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Transmission latérale");
    	}
    	if(m_strList2="31Elements porteurs avant")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Train avant");
    		pLBm->InsertString(-1,"02Fusée - Disque");
    	}
    	if(m_strList2="32Elements non porteurs avant")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Amortisseur");
    		pLBm->InsertString(-1,"02Barre stabilisatrice");
    		pLBm->InsertString(-1,"03Etriers de frein");
    	}
    	if(m_strList2="33Elements porteurs arriere")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Fusee - Disque");
    		pLBm->InsertString(-1,"02Barre de torsion");
    		pLBm->InsertString(-1,"03Train arriere");
    	}
    	if(m_strList2="34Element non porteurs arriere")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Amortisseur");
    		pLBm->InsertString(-1,"02Etriers de frein");
    	}
    	if(m_strList2="35Roues Pneumatiques")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Roues");
    	}
    	if(m_strList2="36Direction")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Direction");
    		pLBm->InsertString(-1,"02Volant de direction");
    	}
    	if(m_strList2="37Commandes aux pieds")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Pedalier");
    		pLBm->InsertString(-1,"02Maitre cylindre de frein");
    		pLBm->InsertString(-1,"03Assistance de Freinage");
    		pLBm->InsertString(-1,"04Repartiteur de freinage");
    		pLBm->InsertString(-1,"05Agrafes");
    		pLBm->InsertString(-1,"06Tuyauterie de frein");
    	}
    	if(m_strList2="38Commandes à main")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Frein a main");
    		pLBm->InsertString(-1,"02Vitesses mecanique");
    		pLBm->InsertString(-1,"03Starter");
    	}
    	if(m_strList2="90Cric Petites fournitures")
    	{
    		CListBox* pLBm = (CListBox*)GetDlgItem(IDC_LISTPR3);
    		pLBm->InsertString(-1,"01Cric");
    	}
     
     
    }
    [/code]

  2. #2
    Membre extrêmement actif
    Homme Profil pro
    Graphic Programmer
    Inscrit en
    Mars 2006
    Messages
    1 550
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Graphic Programmer
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mars 2006
    Messages : 1 550
    Points : 3 952
    Points
    3 952
    Par défaut
    Salut,

    dans ton code se situe plusieurs erreurs :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    if(m_strList1="Mécanique")
       {
    Tu produit une affectation de variable, tu devrais plutôt utilisé :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    if(m_strList1=="Mécanique")
       {
    Ce qui fait que chaque <if> que tu rencontre ne sert à rien et tout est executé comme si de rien etait.

    Pour la deuxieme question : ce dont tu parle s'appelle un splashscreen.

    tu pourras trouver ton bonheur a cette adresse :
    http://c.developpez.com/faq/vc/?page...s#splashscreen[/b]

  3. #3
    Membre du Club
    Homme Profil pro
    Ingénieur développement matériel électronique
    Inscrit en
    Mars 2006
    Messages
    71
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Ingénieur développement matériel électronique

    Informations forums :
    Inscription : Mars 2006
    Messages : 71
    Points : 63
    Points
    63
    Par défaut Je dois avoir une autre erreur ou un oublit
    Merci pour cette correction, je débute avec vc++ et je suis un peux étourdie.

    Suite à la modification dans les if, comme indiqué précédement, les conditions ne sont jamais validé. J'ai ajouté une variable membre de type control et une de type string à chacune des zones de liste, par contre je n'est pas initialisé quelque chose comme me l'avait demandé visual c++, il me semble qu'il s'agissait de IDDX ou un truc comme ça mais je ne sais pas si à cause de cela.

    Si vous avez une idée je suis preneur.

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

Discussions similaires

  1. Zone de liste en cascade
    Par vete25 dans le forum VBA Access
    Réponses: 5
    Dernier message: 09/02/2014, 11h53
  2. [Outils] Compléments de Zone de Liste en cascade dmboup
    Par Arkham46 dans le forum Contribuez
    Réponses: 0
    Dernier message: 19/09/2008, 15h25
  3. [Outils] Compléments de Zone de Liste en cascade Arkham46
    Par Arkham46 dans le forum Contribuez
    Réponses: 0
    Dernier message: 19/09/2008, 15h25
  4. Réponses: 2
    Dernier message: 18/09/2008, 08h20
  5. zone de liste en cascade
    Par alexkickstand dans le forum IHM
    Réponses: 2
    Dernier message: 11/06/2008, 17h03

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