views:

38

answers:

1

I have a UserControl in which a FlowLayoutPanel (FlowDirection is as by default - LeftToRight). This user control consist of a description and some controls: [descr.] 123456789, it should be able to be reversed 987654321 [descr.]

So FlowLayoutPanel is used for this scope(RightToLeft - True/False).

alt text

Is this a way that the label1 fill the rest of the control(to left or right respectively)?

+1  A: 

Unfortunately FlowLayoutPanel doesn't support that kind of behavior.

There are three options I know of:

  1. Manually make the label take up the rest of the space. (Recalculating when the FlowLayoutPanel changes size.) This is complex, especially if you add controls at runtime.

  2. Use TableLayoutPanel instead. It does not have 'flow' characteristics, but it does support the 'fill' behavior you want.

  3. Write your own control which does this. This could get complex.

I would probably go with the TableLayoutPanel, but depending on your circumstances one of the other options may make more sense.

Zach Johnson
hope that in a TableLaoytPanel reversing elements should not be too complicated.
serhio