Modify the properties of the User control of the form to a VB.NET DLL

0

I have a Library created in Visual Basic .NET that accesses properties of a Form , and so far so good! The problem is that when I try to access the UserControl component of the form, nothing in it is changed.

Code:

        Dim PlayerHD As Frm_PlayerHDStudio
        Dim PlayerHD_X As Int32
        Dim PlayerHD_Y As Int32

        PlayerHD = New Frm_PlayerHDStudio()
        PlayerHD_X = PlayerHD.Size.Width
        PlayerHD_Y = PlayerHD.Size.Height
#Region "Primeiro Controle- ControlPlayerHD_InfoVideo"
        'Loc_ << Location do Controle
        'Sz_ << Tamando do Controle

        ''Declação de tamnho e largura do controle

        ''Loc
        Dim Loc_ControleInfoVideoX As Int32 = 0
        Dim Loc_ControleInfoVideoY As Int32 = 0

        ''Sz 
        Dim Sz_ControleInfoVideoX As Int32 = 1366
        Dim Sz_ControleInfoVideoY As Int32 = 10

        ''Localização do Controle InfoVideo
        PlayerHD.ControlPlayerHD_InfoVideo.Location = New Point(Loc_ControleInfoVideoX, Loc_ControleInfoVideoY)

        ''Tamanho do Controle
        PlayerHD.ControlPlayerHD_InfoVideo.Size = New Point(Sz_ControleInfoVideoX, Sz_ControleInfoVideoY)
#End Region

The application does not error but the component that is in Form remains in the same place it does not change its location.

    
asked by anonymous 14.06.2015 / 04:03

1 answer

2

Add the following statements on your last line:

 MyClass.Controls.Add(PlayerHD)
 PlayerHD.Visible = True : PlayerHD.BringToFront()

If not resolve try this:

 PlayerHD.Location = New System.Drawing.PointF(Loc_ControleInfoVideoX, Loc_ControleInfoVideoY)
 PlayerHD.Update()

Or try to use the Dock : property (easier and more convenient)

 PlayerHD.Dock = Windows.Forms.DockStyle.Top 'Alinhamento em cima, você pode colocar qualquer lugar
 PlayerHD.Size = New Drawing.Size(PlayerHD.Width, Sz_ControleInfoVideoX)

Try this, hugs ^ - ^

    
16.06.2015 / 00:54