1

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.

T.S.
  • 18,195
  • 11
  • 58
  • 78
Andrew
  • 437
  • 7
  • 18
  • Editing the designer file should work (only recommended as a last resort though). I suspect there's still a trace of it in there, somewhere. – peterG Jan 07 '17 at 16:54
  • I've looked all over the place :( I commented out the button completely. Both the original name ButtonItem19 and the new name btnSendTestEmail. Still errors out. – Andrew Jan 07 '17 at 17:03

1 Answers1

1

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.

T.S.
  • 18,195
  • 11
  • 58
  • 78
Andrew
  • 437
  • 7
  • 18