Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Can't see form in design mode
 

Can't see form in design mode

I've got a problem. I wan't to put a User Control in a form, but I can't see the form in design mode. There's a exception being thrown:

"Unable to cast object of type 'System.Collections.Generic.List`1[DomainEntities.Interfaces.ITreeNodeEntity]' to type 'System.Collections.Generic.List`1[DomainEntities.Interfaces.ITreeNodeEntity]'.
Hide

at VSproj.Controls.TPGroupingTreeView.set_CheckedItems(Object value) in C:\VSproj\Controls\TPGroupingTreeView.vb:line 136
at VSproj.UserControls.DetailViews.GroupingPersonTreeView.InitializeComponent() in C:\VSproj\UserControls\DetailViews\GroupingPersonTreeView.Designer.vb:line 108
at VSproj.UserControls.DetailViews.GroupingPersonTreeView..ctor() in C:\VSproj\UserControls\DetailViews\GroupingPersonTreeView.vb:line 66 "

I've tried puttingIf Not Me.DesignMode but it doesn't seem to work.

Help please.

FatAlbert1  Thursday, September 13, 2007 11:05 AM

Your code in GroupingPersonTreeView.InitializeComponent method tries to set checked items - something that you would normally want to do at run-time. Follow the stacktree up and see what code is causing it and make sure it is not called at Design time. Remember that constructors and InitializeComponent are used by the Designer engine, so don't put there anything that suppose to run at run-time only.

Hope this helps,

Aleksey

Aleksey Nagoga_  Thursday, September 13, 2007 2:54 PM

Your code in GroupingPersonTreeView.InitializeComponent method tries to set checked items - something that you would normally want to do at run-time. Follow the stacktree up and see what code is causing it and make sure it is not called at Design time. Remember that constructors and InitializeComponent are used by the Designer engine, so don't put there anything that suppose to run at run-time only.

Hope this helps,

Aleksey

Aleksey Nagoga_  Thursday, September 13, 2007 2:54 PM

You can use google to search for other answers

Custom Search

More Threads

• Incorrect Serialization of Collection property in IExtenderProvider
• Can an ExtenderProvider expose Public Events as well
• How to built tab like Ribbon
• Bug - Getting the SelectedItem in ListBox
• Prevent execution of a block of code at design time.
• ToolStrip Problem
• Data Binding with a Hashtable
• DragDrop Events in custom designer not called
• How to use Internal UserControl
• Forms Authentication using C# 2.0