Click here to Skip to main content
15,891,708 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I created a simple winform app normally with a form and some comboboxes on it. I have done the same apps for hundreds of times but yesterday, I saw one of the oddest thing and I think that's surely an error in VS 2008 Express Edition IDE. That was I couldn't access any comboboxes (that I had added to the form) in all methods in the region of the form's class. It seemed that "the form didn't have any comboboxes on it". But it could run with some codes I had written before I realized the odd thing. Especially, the codes I had written before didn't have any access to any comboboxes' properties directly by their name but indirectly by the "sender" in some method handling some event of them. Yeah, it worked well, but when I wanted to add some codes using some access to one of properties of the comboboxes, as I said, I couldn't. I thought "Ghosts do it" not myself or anything scientific. Oh my God, I couldn't believe it. After a moment of thinking, I tried adding a new combobox to the form, and I saw it was normally seen as a member of the form, but the old comboboxes were still "hidden" (Ghosts were still doing it)!
Could you please share with me any suggestion on how it can happen? My story is too simple with no need to post any code here. And I think that can rarely happen!
Posted
Comments
nagendrathecoder 11-Apr-11 8:36am    
Very strange, never seen like this.
[no name] 11-Apr-11 8:56am    
That's why I thought "Ghosts do it"! :)
Even when I want to see it again, I may have no chance!
Richard MacCutchan 11-Apr-11 9:25am    
Try posting some of the code you have in your form and we may be able to guess or figure out what is wrong.
johannesnestler 11-Apr-11 11:48am    
I have seen something similar when working with VS 2008 on Windows CE projects.
This seems to be an VS Designer/code generator issue. If you see the correct code (also in the .designer part of your class) I'd try to delete the obj folder/rebuild. At least this solved my problem. But I have seen other issues where the code generator just deleted the initialization logic in the .designer file but left the Controls declarations in the .designer file... Up to now it never happend with VS 2010

Not surprising. There are times when the visual forms designer gets confused. This is more commonly observed when you modify the designer.cs files. Or if you add code in your form constructor. Upgrading to 2010 may not solve your probem.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 11-Apr-11 13:48pm    
I would rather agree, even though I'm not sure what exactly happened. Designer needs care and, I would say, working with revision control system by smaller steps, to stay our of trouble.
My 5.
--SA
Nish Nishant 11-Apr-11 13:53pm    
Thanks SA!
Try the new VS 2010 Express.
Visual Studio 2010 Express[^]
 
Share this answer
 
Comments
[no name] 11-Apr-11 8:54am    
Good suggestion!
But does that version tell me the reason explaining for the odd thing I saw?
Kim Togo 11-Apr-11 8:59am    
I do not think so. The problem you describe, is probably fixed in a service pack for VS 2008 Express or in VS 2010
[no name] 11-Apr-11 19:43pm    
It is really not my matter! As I said! Even when I want to get that error again, I may not have no chance, it likes "once in a blue moon"! Uprading to the newest version is my hobby but not now when my computer is too old to install any heavy weight version on it, I am waiting for a new one before upgrading anything!
Thank you so much!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900