2

I am using a Toolstrip to draw myself a TabStrip where I do not want the items to overflow, but rather shrink-to-fit the available width. Very much like many browsers tabs behave (ex. Chrome).

I know there is a LayoutEngine property which can be overriden, but I have no clue on how to implement this.

Anyone knows how to make the items fit the toolstrips width?

Lars KJ
  • 632
  • 7
  • 15

2 Answers2

0

The Infragistics .NetAdvantage WinToolbars controls will do this. This is a commercial product, but it may be cheaper to buy a control than build one yourself.

Dour High Arch
  • 21,513
  • 29
  • 75
  • 90
  • Thanx for your suggestion, but I rather not include a giant controls suite for this kind of, in my opinion, rather small issue. Now if I only could find an example on how to implement a LayoutEngine for a ToolStrip... – Lars KJ Nov 23 '10 at 18:52
0

Have a look at this related question:

How to make a ToolStripComboBox to fill all the space available on a ToolStrip?

I prefer Martin's answer because it doesn't have any magic hard-coded numbers in it. While you'll still have to do a bit of arithmetic if you are making multiple items shrink-to-fit, I'm sure the same method would be applicable.

Community
  • 1
  • 1
Ian Goldby
  • 5,609
  • 1
  • 45
  • 81