Click here to Skip to main content
15,897,518 members
Home / Discussions / C#
   

C#

 
GeneralRe: slow speed Pin
girm30-Jul-07 21:51
girm30-Jul-07 21:51 
GeneralRe: slow speed Pin
Xmen Real 31-Jul-07 19:08
professional Xmen Real 31-Jul-07 19:08 
QuestionC# Project corrupted? Pin
Vikas K.29-Jul-07 21:21
Vikas K.29-Jul-07 21:21 
AnswerRe: C# Project corrupted? Pin
T.EDY29-Jul-07 21:53
T.EDY29-Jul-07 21:53 
GeneralRe: C# Project corrupted? Pin
Vikas K.29-Jul-07 23:29
Vikas K.29-Jul-07 23:29 
GeneralRe: C# Project corrupted? Pin
Developer61130-Jul-07 0:05
Developer61130-Jul-07 0:05 
GeneralRe: C# Project corrupted? [modified] Pin
Martin#30-Jul-07 0:08
Martin#30-Jul-07 0:08 
GeneralRe: C# Project corrupted? Pin
Vikas K.30-Jul-07 19:54
Vikas K.30-Jul-07 19:54 
Hi, Ok I know why this is happening but pls tell me whats wrong in doing this?

1. My form is like this: Everything is proper and I can view the designer
<br />
//file Form1.cs<br />
<br />
public partial class Form1 : Form<br />
{<br />
 // many functions/events related to UI controls are here<br />
}<br />

2. I need to have a special control class say MyPictureBox derived from PictureBox so added the code as follows in file Form1.cs:
<br />
//file Form1.cs<br />
<br />
public class MyPictureBox : System.Windows.Forms.PictureBox<br />
{<br />
  // some special code will be put here<br />
}<br />
<br />
public partial class Form1 : Form<br />
{<br />
 // many functions/events related to UI controls are here<br />
}<br />


Thats it: Now If I try to open the designer I get the error:

<br />
One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes. <br />
<br />
The service System.Windows.Forms.Design.ISelectionUIService already exists in the service container. Parameter name: serviceType <br />
Hide     <br />
<br />
at System.ComponentModel.Design.ServiceContainer.AddService(Type serviceType, Object serviceInstance, Boolean promote)<br />
at System.ComponentModel.Design.ServiceContainer.AddService(Type serviceType, Object serviceInstance)<br />
at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IServiceContainer.AddService(Type serviceType, Object serviceInstance)<br />
at System.Windows.Forms.Design.ComponentDocumentDesigner.Initialize(IComponent component)<br />
at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)<br />
at System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name)<br />
at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)<br />
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)<br />
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)<br />
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)<br />
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)<br />
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)<br />
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host) <br />


Afterwards, I will not be able to view the original designer but I think the designer related to MyPictureBox which is blank.

But if I put the body of MyPictureBox after the body of Form as shown below, everything is fine!

<br />
//file Form1.cs<br />
<br />
public partial class Form1 : Form<br />
{<br />
 // many functions/events related to UI controls are here<br />
}<br />
<br />
public class MyPictureBox : System.Windows.Forms.PictureBox<br />
{<br />
  // some special code will be put here<br />
}<br />


Pls let me know what is the procedure in adding a derived UI control class?

Thanks
GeneralRe: C# Project corrupted? Pin
Martin#30-Jul-07 20:02
Martin#30-Jul-07 20:02 
GeneralRe: C# Project corrupted? Pin
Vikas K.30-Jul-07 20:12
Vikas K.30-Jul-07 20:12 
Questionproblem in generating crysatl reports Pin
monuSaini29-Jul-07 21:14
monuSaini29-Jul-07 21:14 
AnswerRe: problem in generating crysatl reports Pin
Edwin Syarief29-Jul-07 22:18
Edwin Syarief29-Jul-07 22:18 
GeneralRe: problem in generating crysatl reports Pin
monuSaini29-Jul-07 22:58
monuSaini29-Jul-07 22:58 
QuestionRe: problem in generating crysatl reports Pin
T.EDY29-Jul-07 23:28
T.EDY29-Jul-07 23:28 
AnswerRe: problem in generating crysatl reports Pin
monuSaini29-Jul-07 23:33
monuSaini29-Jul-07 23:33 
GeneralRe: problem in generating crysatl reports Pin
T.EDY29-Jul-07 23:42
T.EDY29-Jul-07 23:42 
GeneralRe: problem in generating crysatl reports Pin
Edwin Syarief29-Jul-07 23:47
Edwin Syarief29-Jul-07 23:47 
JokeRe: problem in generating crysatl reports Pin
T.EDY29-Jul-07 23:57
T.EDY29-Jul-07 23:57 
GeneralRe: problem in generating crysatl reports Pin
Edwin Syarief29-Jul-07 23:41
Edwin Syarief29-Jul-07 23:41 
GeneralRe: problem in generating crysatl reports Pin
monuSaini30-Jul-07 0:08
monuSaini30-Jul-07 0:08 
GeneralRe: problem in generating crysatl reports Pin
PhilDanger30-Jul-07 3:42
PhilDanger30-Jul-07 3:42 
GeneralRe: problem in generating crysatl reports Pin
monuSaini30-Jul-07 17:22
monuSaini30-Jul-07 17:22 
AnswerRe: problem in generating crysatl reports Pin
Developer61130-Jul-07 0:24
Developer61130-Jul-07 0:24 
GeneralRe: problem in generating crysatl reports Pin
monuSaini30-Jul-07 1:54
monuSaini30-Jul-07 1:54 
GeneralRe: problem in generating crysatl reports Pin
Developer61130-Jul-07 5:10
Developer61130-Jul-07 5:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.