Bonjour,
J'ai un probleme concernant la gestion d'une WinForm.
Voila le code suivant :
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.
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 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.
Code : Sélectionner tout - Visualiser dans une fenêtre à part ShowInTaskbar = true;
Pourriez vous m'aider ?
Merci.
F.
Partager