Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control's Position on Screen
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00827479
Message ID:
00828732
Vues:
19
This message has been marked as a message which has helped to the initial question of the thread.
Hi Arnaldo,

If FormB is inside the MDI parent form, you need to convert the location back to the client position via parent form's PointToClient Method method.


>Thanks for your Reply!
>
>It seems I'm not understanding the way that method works, here is my portion of code.
>
>The situation is:
>I have two forms: frmA, frmB
>In frmA I have a button (btnA)
>In the Button Click I want to show the frmB form in the same location of the button.
>
>
>
>    Private Sub btnA_Click(ByVal sender As System.Object _
>    , ByVal e As System.EventArgs) Handles btnA.Click
>
>        Dim fA As New frmB()
>        Dim pA As System.Drawing.Point
>
>        pA = btnA.PointToScreen(btnA.Location)
>
>        With fA
>            .Show()
>            .Left = pA.X
>            .Top = pA.Y
>        End With
>
>    End Sub
>
>
>
>when I click the button the form shows in another position.
>
>Note: the frmA is MdiChild of another form MdiFrmA.
>
>Am I using the PointToScreen method incorrectly?
>
>Thanks again, in advance!
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform