none
Flowlayoutpanel flowbreak bug. It creates unwanted empty space

    질문

  • When two controls that would fit width-wise are added to a Flowlayoutpanel, and the first one has FlowBreak = true, the FlowLayoutPanel inserts a significant amount of unwanted vertical blank space between the controls.

     

    Even in design time it can be reproduced. Steps are:

    - Create a new form

    - Add a flow layout panel

    - Add a label

    - Add a button

    - Set flowbreak=true on the label

    - Resize the button width-wise. It jumps up and down, the unwanted blank space appears and dissappears, depending on whether it is large enough to fit alongside the label or not.

     

    I'm really surprised noone has made a reference to this bug in msdn forums, or any of the usual search engines.

     

    We have an application that creates controls dynamically, and the client is hammering us with this bug. Help is appreciated.

    2007년 4월 11일 수요일 오후 10:38

답변

  • Yes, I can readily reproduce your problem.   It sure looks like a bug to me.  I can find no other references to this bug, either through Product Feedback or Google.  It is specific to a label being the 1st control.  The amount of space added doesn't seem to depend on any property of the label.  I cannot find a workaround for this bug, other than making either control wide enough.

    I can only recommend you record this bug at Product Feedback.  It is unlikely you'll get a quick workaround or bug fix.  Call MSFT support for a possible quicker workaround or hotfix if you can't afford the wait.
    2007년 4월 12일 목요일 오전 4:19
    중재자

모든 응답

  • Yes, I can readily reproduce your problem.   It sure looks like a bug to me.  I can find no other references to this bug, either through Product Feedback or Google.  It is specific to a label being the 1st control.  The amount of space added doesn't seem to depend on any property of the label.  I cannot find a workaround for this bug, other than making either control wide enough.

    I can only recommend you record this bug at Product Feedback.  It is unlikely you'll get a quick workaround or bug fix.  Call MSFT support for a possible quicker workaround or hotfix if you can't afford the wait.
    2007년 4월 12일 목요일 오전 4:19
    중재자
  • Thanks. I will contact MSFT support.
    2007년 4월 12일 목요일 오후 1:15
  • I realize this issue is pretty old, but I ran into this bug myself and I figured out a workaround I thought might be useful to someone else. 

     

    The vertical size of the gap seems to be the same as the height of the control that follows after the flow break.  So, I just add a panel of Size(0,0) with no margins after the flow break.  That gets rid of the gap.

    2007년 9월 13일 목요일 오후 2:44
  • Thank you, LewisG! Your workaround still helps people ;-)
    2010년 2월 6일 토요일 오전 11:45
  • THANK YOU LewisG - your workaround made my day!

    (Amazing that this bug still exists. Then again, I can't find anything about it in connect. I guess I'll report it.)

     


    2011년 6월 8일 수요일 오후 10:37
  • And still usefull! Thank you, LewisG!
    2014년 4월 26일 토요일 오전 6:52