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
|
Dim MeForm As System.Windows.Forms.Form
Dim MeForm As System.Windows.Forms.Form
Dim Fencli As System.Windows.Forms.Form
Fencli = New System.Windows.Forms.Form()
Fencli.MdiParent = Me
Dim pointHautGauche As System.Drawing.Point
Dim MargeGauchePlusDroite As System.Drawing.Size
' Recuperation de Me en tant que "Form"
MeForm = Me
' Pour faciliter les calculs au besoin...
MeForm.ClientSize = New System.Drawing.Size(300, 400)
Fencli.Size = New System.Drawing.Size(100, 100)
' Calcule des coordonnees du point haut gauche de la fenetre fille.
MargeGauchePlusDroite = MeForm.ClientSize - Fencli.Size
pointHautGauche = New System.Drawing.Point(MargeGauchePlusDroite.Width / 2, MargeGauchePlusDroite.Height / 2)
Fencli.Show()
' Affectation des coordonnees APRES LE "Show()" !!!
Fencli.SetBounds(pointHautGauche.X, pointHautGauche.Y, Fencli.Width, Fencli.Height) |
Partager