0

I have a MDI (IsMdiContainer = True) Visual Basic .NET form in Visual Studio 2013 which is based on a System.Windows.Forms.Ribbon. It contains several RibbonTabs with RibbonPanels and RibbonButtons in them. If I make one of those panels (containing two buttons) not visible at design-time, I can not load the form at design-time anymore. The code the designer adds at the *.Designer.vb file is:

Me.pnl_accions_llistats.Visible = False

Which produces this error message:

Exception of type 'System.ComponentModel.Design.ExceptionCollection' was thrown.

Any idea on how to solve that besides removing the offending panel and their buttons? Found that using the offending line at *.vb in the Load event, works fine but I'm worried about the designer crashing that way.

I tried the solution suggested here but Visual Studio didn't show me any error when opening the form at design-time. However, using source control, I could easily identify the designer line of code that crashes the form.

Community
  • 1
  • 1
Narcís Calvet
  • 7,304
  • 5
  • 27
  • 47
  • Possible duplicate of [System.ComponentModel.Design.ExceptionCollection](http://stackoverflow.com/questions/9579544/system-componentmodel-design-exceptioncollection) – A Friend Feb 13 '17 at 09:15
  • @ProGrammer thanks for the suggestion but that didn't help. I extended my question explaining that. – Narcís Calvet Feb 13 '17 at 09:40
  • Lots of ribbon controls out there, maybe the one you use just doesn't like this. The simple workaround is to set the Visible property to false in your code instead of the designer. Add `Sub New` if necessary, put it after the InitializeComponent() call. Or use the Load event. – Hans Passant Feb 13 '17 at 13:37
  • @HansPassant thanks for your input. Yes, that's what I did as I commented in my question. However, this sort of erratic behaviour makes me slightly nervous. – Narcís Calvet Feb 13 '17 at 15:13
  • Nobody here can make you feel better about it. Talk to whomever owns the control. File a bug. If he's unresponsive then start worrying. – Hans Passant Feb 13 '17 at 15:16
  • @HansPassant thanks for your feedback. It's a Microsoft control, the .NET Framework 4 version with VS2013. Maybe we should to a more modern environment. – Narcís Calvet Feb 14 '17 at 10:57

1 Answers1

0

The only solution I found was using the offending line in the Load event at *.vb.

Narcís Calvet
  • 7,304
  • 5
  • 27
  • 47