0

Image where the blank space is visible. The red is the background color of the flowlayoutpanel where all other panels which are inside it are gray.

From the image could be seen how the flowlayoutpanel leaves blank space between the categories in my menu even though the margins of all panels are set to 0 including the flowlayoutpanel also all labels and buttons margins are set to 0

Managed to fix my problem by implementing it without flowlayoutpanel by using timers :)

Fixed

I'll leave the question open if somebody knows how to fix the flowlayoutpanel situation

Test
  • 53
  • 6
  • 1
    Have you actually set the Panels: `[Panel].Padding = new Padding(0), [Panel].Margin = new Padding(0)` when one is created? The same for the FLP? Can you show the code that builds the FLP and the Panels? – Jimi Jul 10 '19 at 22:10
  • Yes all paddings and margins are set to 0 but this didn't fix the problem. However I decided to try and implement it without flowlayoutpanel as I saw that is some kind of bug related to the flowlayoutpanel's spacing of controls. I managed to do it with timer which synchronises the position of the panels with each other and so I will call it a day :) thanks for the suggestion though. – Test Jul 10 '19 at 22:22
  • The FLP has no such *bug*. – Jimi Jul 10 '19 at 22:28
  • I think it has I saw this thread: https://stackoverflow.com/questions/23448229/strange-empty-spaces-in-flowlayoutpanel and tried to do it with mine program but it either I didn't manage to implement it right for my case (most likely :) ) or else happend wrong, sorry for the bad formatting I'm new to the site. – Test Jul 10 '19 at 22:31
  • It's a feature, more or less the same applies to the TableLayoutPanel (related to the row styles). See the notes and try the code here: [Center multiple rows of controls in a FlowLayoutPanel](https://stackoverflow.com/a/54565075/7444103), setting both the FLP containers' Padding/Margin and the child controls' to `0`. See what happens. (Spoiler alert: all controls will be positioned without any visible space between them). – Jimi Jul 10 '19 at 22:47
  • [Here](https://stackoverflow.com/a/55225457/7444103) there's (more or less) the same code, but there's also a complete Form layout for testing it. – Jimi Jul 10 '19 at 22:58
  • I put all the child panels, buttons, labels and the FLP's padding and margins to zero when I uploaded the picture (the first one) and the problem was still present I tried many different things using FLP like manipulating the margins in a lot of different ways but alas nothing helped to get rid off that space between the categories. However I actually prefer the solution I made with the timer as it simplifies the things a lot. Thanks for the spared time – Test Jul 10 '19 at 23:15
  • No problem. If you're happy with it, then it's good. – Jimi Jul 10 '19 at 23:29

0 Answers0