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

Windows Forms Discussion :

appel d'une interface graphique


Sujet :

Windows Forms

  1. #1
    Membre éclairé
    Étudiant
    Inscrit en
    Août 2008
    Messages
    349
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2008
    Messages : 349
    Par défaut appel d'une interface graphique
    bonjour à tous,
    j'ai un petit problème, je développe une interface graphique, dans le menu je clique sur un Menu Itme et une autre interface graphique apparait, mais ce qui apparait c'est seulement la fenêtre sans son contenu (boutons labels ...), sachant que pour faire apparaitre cette interface j'ai utilisé la méthode show().
    quelqu'un peut m'aider.

  2. #2
    Membre confirmé
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    77
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2006
    Messages : 77
    Par défaut
    Essaies


  3. #3
    Rédacteur
    Avatar de The_badger_man
    Profil pro
    Développeur .NET
    Inscrit en
    Janvier 2005
    Messages
    2 745
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Janvier 2005
    Messages : 2 745
    Par défaut
    Montre nous ton code.

    ShowDialog ne changera rien, c'est juste pour afficher la fenêtre en modal.
    Les règles du forum
    Le trio magique : FAQ + Cours + fonction rechercher
    Mes articles
    Pas de questions par messages privés svp

    Software is never finished, only abandoned.

  4. #4
    Membre éclairé
    Étudiant
    Inscrit en
    Août 2008
    Messages
    349
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2008
    Messages : 349
    Par défaut
    toujours le meme problème

    voilà le code de l'interface :
    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
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
     
    namespace test
    {
        class InterfaceRecherche : Form
        {
            private TextBox textBox2;
            private Label label1;
            private Label label2;
            private Button button1;
            private Button button2;
            private Button button3;
            private Button button4;
     
            private TextBox textBox1;
     
            private void InitializeComponent()
            {
                this.textBox1 = new System.Windows.Forms.TextBox();
                this.textBox2 = new System.Windows.Forms.TextBox();
                this.label1 = new System.Windows.Forms.Label();
                this.label2 = new System.Windows.Forms.Label();
                this.button1 = new System.Windows.Forms.Button();
                this.button2 = new System.Windows.Forms.Button();
                this.button3 = new System.Windows.Forms.Button();
                this.button4 = new System.Windows.Forms.Button();
                this.SuspendLayout();
                // 
                // textBox1
                // 
                this.textBox1.Location = new System.Drawing.Point(16, 37);
                this.textBox1.Name = "textBox1";
                this.textBox1.Size = new System.Drawing.Size(251, 20);
                this.textBox1.TabIndex = 0;
                // 
                // textBox2
                // 
                this.textBox2.Location = new System.Drawing.Point(16, 99);
                this.textBox2.Name = "textBox2";
                this.textBox2.Size = new System.Drawing.Size(251, 20);
                this.textBox2.TabIndex = 1;
                // 
                // label1
                // 
                this.label1.AutoSize = true;
                this.label1.Location = new System.Drawing.Point(17, 21);
                this.label1.Name = "label1";
                this.label1.Size = new System.Drawing.Size(27, 13);
                this.label1.TabIndex = 2;
                this.label1.Text = "Find";
                // 
                // label2
                // 
                this.label2.AutoSize = true;
                this.label2.Location = new System.Drawing.Point(17, 73);
                this.label2.Name = "label2";
                this.label2.Size = new System.Drawing.Size(69, 13);
                this.label2.TabIndex = 3;
                this.label2.Text = "Replace with";
                // 
                // button1
                // 
                this.button1.Location = new System.Drawing.Point(16, 169);
                this.button1.Name = "button1";
                this.button1.Size = new System.Drawing.Size(95, 29);
                this.button1.TabIndex = 4;
                this.button1.Text = "Find";
                this.button1.UseVisualStyleBackColor = true;
                // 
                // button2
                // 
                this.button2.Location = new System.Drawing.Point(166, 170);
                this.button2.Name = "button2";
                this.button2.Size = new System.Drawing.Size(101, 28);
                this.button2.TabIndex = 5;
                this.button2.Text = "Find All";
                this.button2.UseVisualStyleBackColor = true;
                // 
                // button3
                // 
                this.button3.Location = new System.Drawing.Point(16, 219);
                this.button3.Name = "button3";
                this.button3.Size = new System.Drawing.Size(95, 29);
                this.button3.TabIndex = 6;
                this.button3.Text = "Replace";
                this.button3.UseVisualStyleBackColor = true;
                // 
                // button4
                // 
                this.button4.Location = new System.Drawing.Point(166, 219);
                this.button4.Name = "button4";
                this.button4.Size = new System.Drawing.Size(100, 28);
                this.button4.TabIndex = 7;
                this.button4.Text = "Replace All";
                this.button4.UseVisualStyleBackColor = true;
                // 
                // InterfaceRecherche
                // 
                this.ClientSize = new System.Drawing.Size(284, 268);
                this.Controls.Add(this.button4);
                this.Controls.Add(this.button3);
                this.Controls.Add(this.button2);
                this.Controls.Add(this.button1);
                this.Controls.Add(this.label2);
                this.Controls.Add(this.label1);
                this.Controls.Add(this.textBox2);
                this.Controls.Add(this.textBox1);
                this.Name = "InterfaceRecherche";
                this.Text = "Find & Replace";
                this.ResumeLayout(false);
                this.PerformLayout();
     
            }
     
     
        }
    }
     
     
     
    et voici le code de l'appel :
    
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    123456
     
     private void findToolStripMenuItem_Click(object sender, EventArgs e)
            {
              InterfaceRecherche ir = new InterfaceRecherche();
              ir.ShowDialog();
             }

  5. #5
    Membre éprouvé Avatar de Antho42
    Profil pro
    Inscrit en
    Février 2009
    Messages
    173
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Février 2009
    Messages : 173
    Par défaut
    Mais heu ....
    Il faudrait peut être un constructeur à ta classe Form dans lequel tu appelles la méthode InitializeComponent(); non ?

  6. #6
    Membre éclairé
    Étudiant
    Inscrit en
    Août 2008
    Messages
    349
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2008
    Messages : 349
    Par défaut
    c'est bon ça marche merci bien

  7. #7
    Membre confirmé
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    77
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2006
    Messages : 77
    Par défaut
    Citation Envoyé par The_badger_man Voir le message
    Montre nous ton code.

    ShowDialog ne changera rien, c'est juste pour afficher la fenêtre en modal.
    Ca peut changer quelquechose, si comme moi il y a appels de deux forms dans un même threads, pas très souhaité mais ça arrive souvent

  8. #8
    Membre Expert Avatar de Guulh
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    2 160
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Septembre 2007
    Messages : 2 160
    Par défaut
    Citation Envoyé par oolon Voir le message
    Ca peut changer quelquechose, si comme moi il y a appels de deux forms dans un même threads, pas très souhaité mais ça arrive souvent
    La plupart du temps, on laisse les forms dans un même thread, hein Ce sont les fonctionnalités métier (accès aux données, calculs, etc.) qui méritent d'être désynchronisés, pas les fenêtres entre elles.

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

Discussions similaires

  1. appel d'un binaire systeme dans une interface graphique
    Par elbronziero dans le forum Tkinter
    Réponses: 4
    Dernier message: 18/04/2007, 10h01
  2. [résolut]affichage d'une interface graphique des objs AWT
    Par Mayazi dans le forum Eclipse Java
    Réponses: 2
    Dernier message: 16/11/2005, 14h11
  3. [C / Ada] Faire une interface graphique
    Par Casp dans le forum Ada
    Réponses: 6
    Dernier message: 15/04/2005, 15h06
  4. [RECHERCHE] un module pour developer une interface graphique
    Par romtrash dans le forum Eclipse Java
    Réponses: 5
    Dernier message: 10/03/2005, 15h46
  5. comment fonctionne une interface graphique???
    Par elekis dans le forum Langages de programmation
    Réponses: 2
    Dernier message: 27/10/2004, 23h10

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