Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27192

setting a form /panel in the center of another form / panel using code

$
0
0
i am loading a form inside a panel on another form using

Code:


        f = Frm_Profiles
        f.TopLevel = False
        Me.Form_Panel.Controls.Add(f)
        f.Location = New Point((Me.Width - f.Width) \ 2, (Me.Height - f.Height) \ 2) ''width moves left and right - Height moves up and down
        f.Show()

however i am wondering if there is a better method to load that form to the center of the panel atm i use

Code:


        f = Frm_Profiles
        f.TopLevel = False
        Me.Form_Panel.Controls.Add(f)
        f.Location = New Point((Me.Width - f.Width) \ 2, (Me.Height - f.Height) \ 2) ''width moves left and right - Height moves up and down
        f.Show()

however that doesnt work to well i mean it always seems to load the panel wherever it wants

Viewing all articles
Browse latest Browse all 27192

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>