Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a breadcrumb control using FlowLayoutPanel in C#

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?

like image 626
CS. Avatar asked Nov 29 '25 23:11

CS.


1 Answers

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?

like image 65
Edwin Groenendaal Avatar answered Dec 01 '25 12:12

Edwin Groenendaal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!