Windows Forms Editor Exception

563 views Asked by At

I'm not even sure how to ask this question, but here goes. The design view of my windows forms object now crashes with the following error:

The control DevComponents.DotNetBar.Office2007RibbonForm has thrown an unhandled exception in the designer and has been disabled. Exception: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Stack trace: at DevComponents.DotNetBar.Office2007RibbonForm.WindowsMessageStyleChanged(Message& m) at DevComponents.DotNetBar.Office2007RibbonForm.WndProc(Message & m)

When the error page pops up, it is this:

Error Image

I can't think of anything I did before this happened, which is very frustrating. The last thing I did was this:

  1. Add Button on Ribbon Control
  2. Double-Clicked the button to add code
  3. Realized I forgot to name the button, so removed the event code
  4. clicked back on the form tab and BAM. Error.

I tried the following to fix:

  • Went back and did an undo on the code (re-added the event for that button). But didn't help.
  • Edited the Designer.vb file to remove that button entirely. Still didn't help.

I thought about pasting my designer code here... I will if that makes sense, but it is so huge I wasn't sure if that was worthwhile. Maybe the above error makes sense to someone besides me???

**** EDIT: Forgot to mention the application runs fine. Just can't edit the form anymore.

1

There are 1 answers

0
Andrew On

OK. I found it. For some reason the form duplicated the style on the ribbon control. Even though the error didn't seem like that one.

FYI - I just kept commenting out stuff in the designer and then trying to launch the form until the error went away. When I finally got to the ribboncontrol, I saw that there were 2 statements:

'Me.RibbonControl1.Office2007ColorTable = DevComponents.DotNetBar.Rendering.eOffice2007ColorScheme.Silver

and

Me.RibbonControl1.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled

As you can see, I commented out the first one and everything worked.