Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to move parent form pointer change size,son form cha
Message
De
10/05/2011 09:07:14
 
 
À
10/05/2011 08:41:52
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01510136
Message ID:
01510157
Vues:
39
>ok la~~~ thank you , but if i want to base on parent form change size? ...
>How to current location - before location ?
>
>
>Private Sub MainForm_SizeChanged(ByVal sender As Object, ByVal e As EventArgs)
>        Dim f As Form = DirectCast(sender, Form)
>        ChildForm.Width = f.Width / 2                          <?
>        ChildForm.Height = f.Height / 2                      <?
>        'Or whatever
>    End Sub
>
>
Not sure I understand what you want. If you want to keep the child form proportional then maybe something like:
ublic Class Form1
    Private ChildForm As Form
    Private OldSize As Size

    Public Sub New()
        InitializeComponent()
        OldSize = Me.Size
        ChildForm = New ChildForm()
        ChildForm.MdiParent = Me
        ChildForm.Width = 200
        ChildForm.Height = 200
        ChildForm.Show()
     End Sub

    Private Sub MainForm_SizeChanged(sender As Object, e As EventArgs) Handles Me.SizeChanged
        Dim f As Form = DirectCast(sender, Form)
        ChildForm.Size = New Size(ChildForm.Width + Me.Width - OldSize.Width, ChildForm.Height + Me.Height - OldSize.Height)
        OldSize = Me.Size
    End Sub
End Class
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform