3

I was thinking about ways to exploit the flow layout panel control, and I thought about the idea of using this control as a base for a breadcrumb control.

The standard I'm aiming for being the Windows 7 Explorer addressbar/breadcrumb-like.

The benefits is that you can put any control inside it, like drop-down, button - whatever ultimately inherits from the Control class.

I thought of using a stack to keep track of the order and synchronizing the Controls property.

Anyone have some ideas for this project? Is it viable? Anyone have experiences with FlowLayoutPanel, good or bad?

CS.
  • 1,845
  • 1
  • 19
  • 38

1 Answers1

3

What do you expect from the answer?

You can use the FlowLayoutPanel to implement breadcrumbs (I once did one that used labels for the 'crumbs', separated by arrows (like the Win 7 control) )

It's easy enough to implement Push() and Pop() methods (Push should add the arrow and then the control you want to add) and the Pop() should remove the last control and the arrow before that)

The main consideration is what you do when the contents don't fit. My control didn't handle that (it didn't have to) but the Win 7 control cleverly hides the first part of the trail, replacing it with a << chevron. The FLowLayoutPanel doesn't do that for you.

Hope this helped you out?

Edwin Groenendaal
  • 2,304
  • 16
  • 8
  • Good suggestions. I know FLP doesnt support alot of things natively but this would have to be implemented if you wrote your own Breadcrumb control. I suppose some math could figure out if the contents overflow and replace the first sections with a double chevron like W7, but still keep the internal list, possibly adding a different list for items that are in "overflow" state? Additionally override paint on controls to beautify them. – CS. Oct 26 '11 at 13:03
  • Yep that would be it - not too complicated, even. Good luck! – Edwin Groenendaal Oct 27 '11 at 17:20