Move TextBox created by code

0

I'm trying to move a TextBox that was created via code, down. Here is the code where I create and add the button:

    private DVJPetControles.TextBox txtHorarioCheckin;

    this.txtHorarioCheckin.TituloLabel = "Horário de Check-in";
    this.txtHorarioCheckin.TxtPrincipalMask = "00:00";
    this.txtHorarioCheckin.TxtPrincipalTextAlign = 
    HorizontalAlignment.Center;
    this.txtHorarioCheckin.Size = new System.Drawing.Size(189, 45);
    this.txtHorarioCheckin.TabIndex = 
    chkPreAgendarApenasConcluido.TabIndex + 1;
    this.txtHorarioCheckin.Tipo = DVJPetControles.textBoxTipo.Hora;
    this.txtHorarioCheckin.Leave += new 
    System.EventHandler(this.txtHorarioCheckin_Leave);

    flpPetshop.Controls.Add(this.txtHorarioCheckin);

Soon after I try to put it down:

    this.txtHorarioCheckin.Top += 200;

I followed Debug and realized that even changing the top of it, it maintains a fixed value in the top.

I have tried the following also:

    this.txtHorarioCheckin.Location = new Point(200, 200)
    
asked by anonymous 22.11.2018 / 12:22

1 answer

1

The correct way to reposition a component is by using the Location property, just like you did.

If this is not working, you should check that the Dock property is different from None.

Another possible check would be in the nature of your flpPetshop component. If it is of the Stack type, where it stacks the internal components, then this could be the problem.

    
07.12.2018 / 12:46