Click here to Skip to main content
15,920,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've been trying to make my own ToolStripItem and it went well for a while.

The item shows up in the designer but when there is another item to it's right (left doesn't matter), it crashes the designer and the application (Not VS). The error is listed below.

I believe it has something to do with events.
If there's a tutorial on implementing custom ToolStripItems, I haven't seen any yet.

Code: C# .Net 4
=-= Visual Studio (2010) Error =-=

The control System.Windows.Forms.ToolStrip has thrown an unhandled exception in the designer and has been disabled.
Parameter is not valid.

Stack trace:
at System.Windows.Forms.ToolStripRenderer.OnRenderItemText( ToolStripItemTextRenderEventArgs e )
at System.Windows.Forms.ToolStripProfessionalRenderer.OnRenderItemText(ToolStripItemTextRenderEventArgs e )
at System.Windows.Forms.ToolStripRenderer.DrawItemText (ToolStripItemTextRenderEventArgs e)

at System.Windows.Forms.ToolStripLabel.PaintText(Graphics g)
at System.Windows.Forms.ToolStripLabel.OnPaint (PaintEventArgs e)

at System.Windows.Forms.ToolStripItem.HandlePaint (PaintEventArgs e)
at System.Windows.Forms.ToolStripItem.OnPaint(PaintEventArgs e)
at System.Windows.Forms.ToolStripItem.HandlePaint(PaintEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripEvenType met)

at System.Windows.Forms.ToolStrip.OnPaint(PaintEventArgs e)
at System.Windows.Forms.ToolStrip.System.Windows.Forms.ToolStrip.WndProc(Message& m)
Updated 21-Nov-10 3:45am

1 solution

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900