Move Textbox created by code

Asked

Viewed 41 times

0

I’m trying to move a Textbox that was created via code, down. Follow 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 him down:

    this.txtHorarioCheckin.Top += 200;

I followed by Debug and realized that even changing his top, it keeps a fixed value in the top.

I’ve tried it this way too:

    this.txtHorarioCheckin.Location = new Point(200, 200)
  • What control is the flpPetShop?

  • @Gabrielhenrique Soon after when?

1 answer

1


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

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

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.