UserControl

Is it possible to add an user control to my project (For ex: MyControl.cs : Control) without an .resx file. i.e. if we look as the MyProject.csproj file I want MyControl.cs to have s subtype of 'Code'.

We want a control that is derived from Control, but is built at runtime, so we don't need designer support.  However, whenever we choose ReBuild Solution, Visual Studio automatically changes SubType to "UserControl" and then complains that there is no .resx file.
sreenathsAsked:
Who is Participating?
 
RoninTheCommented:
open your .csproj in notepad. delete the lines where it references MyControl.resx. and never open MyControl.cs in designer.

AFAIK, Visual Studio won't create .resx till you don't open it in designer, even if its subtype- usercontrol.

try this, add a blank code file to the project, copy MyControl.cs code in it, and remove MyControls.cs. In all probability it should work.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.