I have a new favorite blog:

Even though the author is gone and no longer posts to it, there are years of nitty gritty details about WinForms available, especially the ins and outs of things like ToolStrip. I have no idea how I did not find this previously. I searched high and low for a custom ToolStripRenderer to bootstrap me when I first started ToolStrip, to no avail. (In fact, I didn't even find this by searching for ToolStrip, I was actually searching for an example of what I should do in ProcessMnemonic.)

One thing that caught my eye was a demonstration (MS Word) of how to make a ToolStrip render like the tabs used for documents in Visual Studio 2005. For example:

It turns out this is a great testcase for me. Implementing a public API so that it performs what a user expects is one thing. Behaving correctly when someone has selectively overridden completely random protected functions of your implementation is another thing. So I ripped out the VS designer stuff and put the rest on top of Mono's ToolStrip.

I am relatively proud of how well my implementation stood up. I had to implement a missing method (SetItemLocation), tweak the SetDisplayedItems, and apparently borders are drawn last on a ToolStrip instead of first. In the end, I got a more accurate implementation and this:

Now I just need to get this guy to post his promised VistaToolStripRenderer. :)

Note: I still have to clean up my ToolStrip changes, so they are not in SVN yet.


alexander said…
Dear sir!

Please, consider the following proposition: to replace all built in mono methods, which receive path strings, with the similar
methods, having the only difference: they must convert both "\" and "/" to "Path.DirectorySeparatorChar".
Then the problem of Windows paths portabibility will be solved once and for all and applications will become truly portable without
the need to amend the application code.
Of cource, I am aware of great number of such methods, but the number of applications is even more great.
Also the number of the methods is strictly limited. Every method, which receives path, receives only path and nothing else in that

Sincerely yours
Alexander Sisonyuk
Kyiv, Ukraine

Popular posts from this blog

Hack Week 3

Mono in Visual Studio 2010

Introducing Pinta