Click here to Skip to main content
15,860,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to find out how to get more control on the actual flow of the flowlayout panel.

I can see on the right hand side you can set it so it goes lefttoright, right to left top to bottom etc, but I need one more option, and I can't seem to find it.

I'm able to remove textboxes from the flowlayoutpanel - I can have upto 8 textboxes on the screen at anytime. When I click on the textbox, it removes that textbox.

But, when I remove the textbox, as the flow suggests it will shift every control down one.

That's not what I need.

On creation, I want it to follow the flow rules set for the flowlayout panel, but when a control is moved, I don't want the items to shift down.

In short if a textbox is removed, when a new box is created it would look to see the first open space on the left.

Is this possible?
Posted

1 solution

I really doubt that the design you have invented is a good design, but you can implement it. For example, you could use, instead of your controls, a custom control: a panel and a child control on it. Instead of removing the control, hide it, and leave its parent panel as a placeholder. You need to adjust the size of the panel to its child control when you shown the control, but preserve the size when you hide it. Then you can replace the hidden control with something else to mimic the situation when a new control picks a first "open space".
—SA
 
Share this answer
 
Comments
Mendaharin 2-Mar-14 23:56pm    
I'm just starting to get to grips with programming, so creating custom controls - I will probably be at a loss at to where to start (Bit like now I'm guessing) The issue I have is textboxes will often change size depending on the lines required for data, I'm not sure if hiding and using the original placesetter would work, as the lines required might make the new control overlap an old control and hide required information. I thought using the flowlayout panel, it would do most of the guess work for me in relation to the placement of the control from left to right.
Sergey Alexandrovich Kryukov 3-Mar-14 0:11am    
In number of cases, you need to prototype several design idea, to see how it works out. To get better help, try to start your questions with explanation of some ultimate goal. If you make some decision and ask about its implementation without any motivation, the question is: is your decision good or even make sense?
—SA
Mendaharin 3-Mar-14 1:29am    
I've just reposted what I'm trying to do. This might explain the backstory as to what I am trying to achieve. Would you be able to tell me if this is understandable?

http://www.codeproject.com/Questions/737616/Kitchen-Video-System-project
Sergey Alexandrovich Kryukov 3-Mar-14 9:26am    
It depends on what one would like to understand. From the first lines, it puzzles. What are those messages, why are they sent and what is their value? Can you see the point? To evaluate some design, on would need to understand why a user wants to see each message. Why printing them? And so on...
At first glance, the design does not look reasonable to me, but the goal is important; and you never explain the goal.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900