I have a MFC dialog in Visual C++ 2005, (MFC Application) and I have added several controls to it. But Visual Studio has no option for deleting a control if I no longer need it. Is there any easy way to do that except modifying all the code where a reference to the control appears?
From stackoverflow
-
I'm pretty sure selecting the offending control on the design sheet and pressing delete works?
Ove : It does, but doing so leaves behind portions of code in the header and cpp files, and you will get a pretty ugly error 99% of the time. I was thinking about deleting the control and all code associated with it.Patrick : I've never got an error, the code remaining is a feature :) -
There is no way to automatically remove all related code. One method that can help the manual removal is to use "Find all references" before removing the object in the designer. Then after deleting it, navigate to the references and remove the related code.
0 comments:
Post a Comment