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
|
Public Class MDIParent
Inherits System.Windows.Forms.Form
Private WithEvents Chambres As ChildChambres
Private WithEvents Reservations As ChildReservations
Public Sub New()
MyBase.New()
InitializeComponent()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
Private components As System.ComponentModel.IContainer
Friend WithEvents MenuPrincipal As System.Windows.Forms.MainMenu
Friend WithEvents AffChambres As System.Windows.Forms.MenuItem
Friend WithEvents AffReservations As System.Windows.Forms.MenuItem
Friend WithEvents Quitter As System.Windows.Forms.MenuItem
Friend WithEvents Horloge As System.Windows.Forms.MenuItem
Friend WithEvents Timer1 As System.Windows.Forms.Timer
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.MenuPrincipal = New System.Windows.Forms.MainMenu()
Me.AffChambres = New System.Windows.Forms.MenuItem()
Me.AffReservations = New System.Windows.Forms.MenuItem()
Me.Quitter = New System.Windows.Forms.MenuItem()
Me.Horloge = New System.Windows.Forms.MenuItem()
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
'
'MenuPrincipal
'
Me.MenuPrincipal.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.Horloge, Me.AffChambres, Me.AffReservations, Me.Quitter})
'
'AffChambres
'
Me.AffChambres.Index = 1
Me.AffChambres.Text = "Affichage des chambres"
'
'AffReservations
'
Me.AffReservations.Index = 2
Me.AffReservations.Text = "Affichage des réservations"
'
'Quitter
'
Me.Quitter.Index = 3
Me.Quitter.Text = "Quitter"
'
'Horloge
'
Me.Horloge.Index = 0
Me.Horloge.Text = "Le "
'
'Timer1
'
Me.Timer1.Interval = 1000
'
'MDIParent
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(777, 280)
Me.Font = New System.Drawing.Font("Arial", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.IsMdiContainer = True
Me.Menu = Me.MenuPrincipal
Me.Name = "MDIParent"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "MDIParent"
End Sub
Private Sub MDIParent_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Horloge.Text = "Le " & DateTime.Now.ToLongDateString & " à " & DateTime.Now.ToLongTimeString
Me.Horloge.Enabled = False
Me.Timer1.Start()
End Sub
Private Sub Chambres_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles Chambres.Closing
'confirmer ou pas ici la fermeture en cours de Chambres
End Sub
Private Sub Reservations_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles Reservations.Closing
'confirmer ou pas ici la fermeture en cours de Reservations
End Sub
Private Sub AffChambres_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AffChambres.Click
If (Me.Chambres Is Nothing) Then
Me.Chambres = New ChildChambres()
Me.Chambres.MdiParent = Me
Me.Chambres.Visible = True
End If
Me.Chambres.BringToFront()
Me.Chambres.Dock = DockStyle.Fill
End Sub
Private Sub AffReservations_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AffReservations.Click
If (Me.Reservations Is Nothing) Then
Me.Reservations = New ChildReservations()
Me.Reservations.MdiParent = Me
Me.Reservations.Visible = True
End If
Me.Reservations.BringToFront()
Me.Reservations.Dock = DockStyle.Fill
End Sub
Private Sub Quitter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Quitter.Click
Application.Exit()
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Horloge.Text = "Le " & DateTime.Now.ToLongDateString & " à " & DateTime.Now.ToLongTimeString
End Sub
End Class |