John Mattingly Posted March 6, 2007 Report Share Posted March 6, 2007 I've observed that if I alter the design of a chart in a user control, the form designer will sometimes throw an exception when I try to edit any form containing that user control. In particluar, I've noticed that if I alter either the Background or Border property of the chart, such that the component designer sets one of these properties in InitializeComponent, the form designer throws an exception complaining that the set_Background (or set_Border) method was not found. Furthermore, the problem occurs whenever my user control's constructor, or any method called by it (like InitializeComponent), attempts to either get or set the Background or Border properties. I only encounter this problem when the chart is embedded in a user control. It does not occur if the chart is embedded in a form. Finally, the problem doesn't occur at run-time; it only occurs at design-time. Please note that it shouldn't be a license issue. The user control is a component of the executable, which has the license embedded. I've attached an example of offending code. The problem can only be resolved by (1) removing the component designer code that sets the Background property, or (2) exiting Visual Studio with both the user control and the containing form open for editing and then restarting Visual Studio. Does anyone have a suggested fix? Link to comment Share on other sites More sharing options...
Frank Posted March 7, 2007 Report Share Posted March 7, 2007 I have your project but I'm unable to reproduce the issue. What do I need to do? Link to comment Share on other sites More sharing options...
John Mattingly Posted March 7, 2007 Author Report Share Posted March 7, 2007 I'm sorry, Frank. After I uploaded the example, I found that the problem could be resolved by closing and restarting Visual Studio. If you still want to try to reproduce it, here are the steps: (1) Create a new windows application project. (2) Add a new user control to the project; put a chart on the user control. (3) Add the user control to the main form. (4) Change the border or background of the chart in the user control, e.g., set the border type to 'Embed'. (5) Go back to the design view of the main form. You should see an error like the attachment. Now that I know I can exit and restart Visual Studio, I guess I can live with that. It may be a problem on their end, anyway. Thanks Link to comment Share on other sites More sharing options...
Frank Posted March 26, 2007 Report Share Posted March 26, 2007 We can reproduce the problem but we can't determine why it happens. We will keep investigating. Link to comment Share on other sites More sharing options...
Henrik Posted July 5, 2007 Report Share Posted July 5, 2007 I have the same problem. I get errors in my designer on very many of my usercontrols, where I have deployed a fxchart. Errors usely happens when I changes someting in the properties. The error messages are often different. Link to comment Share on other sites More sharing options...
Frank Posted July 17, 2007 Report Share Posted July 17, 2007 We are unable to determine why VS is crashing in this case. Notice that the case described by the original poster is deriving a control from the Chart Class. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.