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# Discussion :

Stackoverflow sur ShowTaskBar


Sujet :

C#

  1. #1
    Membre confirmé Avatar de Flow_75
    Femme Profil pro
    Ingénieure
    Inscrit en
    Mai 2005
    Messages
    1 096
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 40
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieure
    Secteur : Transports

    Informations forums :
    Inscription : Mai 2005
    Messages : 1 096
    Points : 633
    Points
    633
    Par défaut Stackoverflow sur ShowTaskBar
    Bonjour,

    J'ai un probleme concernant la gestion d'une WinForm.

    Voila le code suivant :

    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
            private void peinÉcranToolStripMenuItem_Click(object sender, EventArgs e)
            {/*
                if(bPleinEcran)
                {
                    ControlBox = true;
                    FormBorderStyle = FormBorderStyle.Sizable;
                    Height = m_iCurrentH;
                    Width = m_iCurrentW;
     
                    Location = new Point(m_iCurrentX, m_iCurrentY);
                    bPleinEcran = false;
                }
                else
                {
                    ControlBox = false;
                    m_iCurrentH = Height;
                    m_iCurrentW = Width;
     
                    FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     
                    Rectangle rect = Screen.FromControl(this).Bounds;
     
                    Height = rect.Height;
                    Width = rect.Width;
     
                    m_iCurrentX = Location.X;
                    m_iCurrentY = Location.Y;
     
                    Location = new Point(0, 0);
                    bPleinEcran = true;
                }*/
     
                if(bPleinEcran)
                {
                    FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
                    WindowState = FormWindowState.Normal;
                    bPleinEcran = false;
                }
                else
                {
                    FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                    WindowState = FormWindowState.Maximized;
                    bPleinEcran = true;
                }
            }
     
            private void Form1_Resize(object sender, EventArgs e)
            {
                if(Properties.Settings.Default.MaskOnMinimize && WindowState == FormWindowState.Minimized)
                {
                    ShowInTaskbar = false;
                }
            }
     
            private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
            {
                if(WindowState == FormWindowState.Minimized)
                {
                    ShowInTaskbar = true;
                    WindowState = FormWindowState.Normal;
                }
            }
    Quand je lance mon programme, que je réduis mon application en barre de tache et que je fais doubleclick sur mon icone de notification, l'application se comporte normalement. Je peux fais plein de cycle reduit/restaurer de ma fenetre.

    Quand je mets mon application en plein ecran, que je la reduis dans l'icone de notification, puis que je doubleclick dessus, j'ai une exception qui se lance au moment du

    J'ai essayé les deux version de code pour la mise en pleine ecran. Mais aucune des deux marchent.
    Pourriez vous m'aider ?
    Merci.
    F.

  2. #2
    Expert éminent sénior Avatar de Pol63
    Homme Profil pro
    .NET / SQL SERVER
    Inscrit en
    Avril 2007
    Messages
    14 154
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France, Puy de Dôme (Auvergne)

    Informations professionnelles :
    Activité : .NET / SQL SERVER

    Informations forums :
    Inscription : Avril 2007
    Messages : 14 154
    Points : 25 072
    Points
    25 072
    Par défaut
    regarde la pile des appels tu comprendras mieux ce qui tourne en boucle
    Cours complets, tutos et autres FAQ ici : C# - VB.NET

  3. #3
    Membre confirmé Avatar de Flow_75
    Femme Profil pro
    Ingénieure
    Inscrit en
    Mai 2005
    Messages
    1 096
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 40
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieure
    Secteur : Transports

    Informations forums :
    Inscription : Mai 2005
    Messages : 1 096
    Points : 633
    Points
    633
    Par défaut
    Une idée d'où ca pourrait venir ?

    Pièce jointe 340729

  4. #4
    Membre confirmé Avatar de Flow_75
    Femme Profil pro
    Ingénieure
    Inscrit en
    Mai 2005
    Messages
    1 096
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 40
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieure
    Secteur : Transports

    Informations forums :
    Inscription : Mai 2005
    Messages : 1 096
    Points : 633
    Points
    633
    Par défaut
    bon, j'ai trouvé la solution.

    Il faut d'abord remettre la fenetre en mode taille normal, puis afficher l'icone dans la barre des taches.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
                if(WindowState == FormWindowState.Minimized)
                {
                    WindowState = FormWindowState.Normal;
                    ShowInTaskbar = true;   
                }
    et non :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
                if(WindowState == FormWindowState.Minimized)
                {
                    ShowInTaskbar = true;  
                    WindowState = FormWindowState.Normal;
     
                }

  5. #5
    Expert éminent sénior Avatar de Pol63
    Homme Profil pro
    .NET / SQL SERVER
    Inscrit en
    Avril 2007
    Messages
    14 154
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France, Puy de Dôme (Auvergne)

    Informations professionnelles :
    Activité : .NET / SQL SERVER

    Informations forums :
    Inscription : Avril 2007
    Messages : 14 154
    Points : 25 072
    Points
    25 072
    Cours complets, tutos et autres FAQ ici : C# - VB.NET

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

Discussions similaires

  1. StackOverFlow sur ViewFlipper en 1.6
    Par Ghunter59 dans le forum Android
    Réponses: 1
    Dernier message: 08/09/2010, 09h52
  2. Réponses: 2
    Dernier message: 11/09/2006, 12h22
  3. [Kylix] Kylix embarqué sur PDA ?
    Par Anonymous dans le forum NoSQL
    Réponses: 10
    Dernier message: 29/11/2002, 13h59
  4. F.A.Q, Doc, cours, tutoriels sur JBuilder
    Par Ricky81 dans le forum JBuilder
    Réponses: 0
    Dernier message: 14/03/2002, 15h28

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