Petit coup de main à Nostradamus qui a déjà bien mâché le boulot
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 REM :FORM ConsulIECS1 Public Delegate Sub FermetureFenetreEvent(ByVal sender As Object, ByVal e As System.EventArgs) Public Class ConsulIECS1 Inherits System.Windows.Forms.Form Public Event FermetureFenetre As FermetureFenetreEvent Public Sub New() MyBase.New() '''etc... End Sub REM :Sur fermeture de ConsulIECS1 (par exemple) Private Sub ConsulIECS1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed If Not IsNothing(FermetureFenetre) Then RaiseEvent FermetureFenetre(Me,System.EventArgs.Empty); End sub '''etc... End Class REM :FORM ConsulIE1 Public Class ConsulIE1 Inherits System.Windows.Forms.Form Private WithEvents eventConsulIECS1 As ConsulIECS1 Public Sub New() MyBase.New() '''etc... End Sub REM :Ouverture form ConsulIECS1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Enabled = False Dim f As New ConsulIECS1 AddHandler f.FermetureFenetre, AddressOf fermerfenetre f.MdiParent = Me.ParentForm f.Show() End Sub REM :appel de l'évenement Private Sub fermerfenetre(ByVal sender,ByVal e As System.EventArgs) Me.Focus() Me.Enabled = True Me.TextBox1.Focus() End Sub '''etc... End Class
Partager