question

YRK-33345 avatar image
0 Votes"
YRK-33345 asked ·

the object not move up

I have a text box and he stays in the same position in relation to the picture, I do it's with the anchor bottom but he not move up in relation to the picture

76405-ezgif-1-94d2ea522b24.gif


dotnet-csharp
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

cooldadtx avatar image
0 Votes"
cooldadtx answered ·

It's really, really hard to see what you're talking about in your fast moving image. From what I can tell you have a sentence with an underscore in the middle of it. You put a textbox on top of that and as the form is resized you want the textboxes to move as well.

I'd have to think about it for a while but I don't think Anchor is going to solve your problem. An anchor fixes the position of the control relative to its parent. By making the form taller the textboxes would simply stay the same distance from the bottom if you anchored bottom.

My gut instinct is that you'll need to use a container. Given that you have a series of questions I'm thinking a FlowLayoutPanel would work here or perhaps a table if you need columns as well. The master flow layout is vertical to cause the questions to stack. Each question is another FlowLayoutPanel set horizontally. Within the question panel is a label, textbox and label. If you want the textboxes to get taller as you resize then set the Anchor to TopBottom. If you want the Textbox to get wider then set LeftRight. But you'll likely want to set a min/max size on the panels so they don't get too large. You'll need to play around with the layout until it resizes in all directions the way you want.

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.