I have a Visual Studio 2005 C# Windows application. I suddenly realized that when i changed the startup object to another form, the initial startup form would still be first to appear on running the application. I thought i would look at it later and opened a different C# solution that i am also working on. On this one, I made some changes to a form by placing controls on it. But the controls dont appear at runtime, although their visible property is correctly set to true. I try to set some breakpoints in code, but both solutions don't appear to recognize them. However, when i create a new solution, everything seems fine. Any ideas?
Changes To Visual Studio 2005 Forms/Project Not Reflected at Runtime
Collapse
X
-
Where did you change the initial startup form?
There should be something to the effect of:
in the main() function.Code:Application.Run(new Form1());
You would need to change that line to change what form is loaded at startup.
Also, if ANY copies of the program are open (or "stuck" open, check your taskmanager) it will not actually finish BUILDing and your changes won't show up when you tell it to "run", you'll just have another copy of the old build running. -
As Plater said, you should look at program.cs and change for initial form if you have only one project. The startup object is for another project in your solution.Originally posted by gkinuI have a Visual Studio 2005 C# Windows application. I suddenly realized that when i changed the startup object to another form, the initial startup form would still be first to appear on running the application. I thought i would look at it later and opened a different C# solution that i am also working on. On this one, I made some changes to a form by placing controls on it. But the controls dont appear at runtime, although their visible property is correctly set to true. I try to set some breakpoints in code, but both solutions don't appear to recognize them. However, when i create a new solution, everything seems fine. Any ideas?
Cheers.Comment
-
Thanks for your reply. I had actually checked the main() function. No problem there. I even restarted the IDE and the Laptop to no avail. Its now the second day and I have been forced to create another solution and imported the files. Everything works ok now, bugt I don't know for how long.Originally posted by PlaterWhere did you change the initial startup form?
There should be something to the effect of:
in the main() function.Code:Application.Run(new Form1());
You would need to change that line to change what form is loaded at startup.
Also, if ANY copies of the program are open (or "stuck" open, check your taskmanager) it will not actually finish BUILDing and your changes won't show up when you tell it to "run", you'll just have another copy of the old build running.Comment
-
Originally posted by PlaterPerhaps you could post some of the offending code?
And have you looked in taskmanager to see if any copies of the program are still running?
There is no code in particular. Remember the problem is not only startup form, but even any changes i make is not reflected when i run the application e.g. I place new controls on the form, they wont be seen even though visible is set to true. When i place breakpoints in the code, its like they are not recognized.Comment
-
There is only one Form1. Breakpoints stay solid red.Originally posted by PlaterWhen you run in debug mode, do your breakpoints stay solid red or go hollow circles?
Are you sure you are calling the right objects? And don't have multiple forms named "Form1" or something?
Anyway, i recreated a new solution and imported all the forms and other classes. Its working now, but old one still does not. So I would still be very intrerested to know what could have happened. And remember it also affected another completely different solution the same way!
Thanks very much for your help.Comment
Comment