Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MDI Forms
Message
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Titre:
Divers
Thread ID:
00503670
Message ID:
00503907
Vues:
21
>Is there a way to stop that awful resize that occurs when you open a child form in an MDI. I am having issues with gotfocus and lost focus not fireing. Anyone have any ideas about that. I tried to make the form rezizable in the gotfocus event. When border is not resizable the resize doesn't occur but the got focus event didn't fire i tried the activate event and it didn't error but you couldn't resize the form...

A form will receive the focus events only if there are no controls on the forms that can receive the event.

Use the Activate event.

I have this code that i call from the Activate event (Call MoveEcran(Me)) of child forms to resize them:
Public Sub MoveEcran(ByVal pEcran As Form, _
                     Optional ByVal pLeft As Single = -1, _
                     Optional ByVal pTop As Single, _
                     Optional ByVal pWidth As Single, _
                     Optional ByVal pHeight As Single)
Dim I As Integer
Dim intCompteur As Integer
Dim lngHeight As Long

    If pLeft = -1 Then
        ' * Initialisation des variables *
        intCompteur = 0
        lngHeight = mdiMain.ScaleHeight

        mdiMain.Arrange vbArrangeIcons

        For I = 0 To Forms.Count - 1
            If Forms(I).WindowState = vbMinimized Then
                intCompteur = intCompteur + 1
                If Forms(I).Top < lngHeight Then
                    lngHeight = Forms(I).Top
                End If
            End If
        Next I

        If intCompteur <> I - 1 Then
            pEcran.WindowState = vbNormal
            pEcran.Move 0, 0, mdiMain.ScaleWidth, lngHeight
        End If
    Else
        pEcran.Move pLeft, pTop, pWidth, pHeight
    End If
End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform