Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control's Position on Screen
Message
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00827479
Message ID:
00828732
Views:
18
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform