简体   繁体   中英

how to get usercontrol to update

This is in MSVC# 2008. I wrote a simple usercontrol that has 2 labels, 2 textboxes and 1 button. I also created a few properties for the user to set the labels' and the button's text.

I added this usercontrol to a form, compiled and ran it and it worked fine. Then today I went back and added another similar property. Now suddenly the new one wouldn't get recognized when I tried to set it. I was curious, so I tried to comment out one of the old properties, rebuilt everything again, and I still saw the supposedly "deleted" property showing up in the list.

What is going on? What must I do to get it to "update" when rebuilding doesn't? If you need to see the code please let me know.

EDIT: Thank you all for replying. I apologize for not having mentioned that they do have separate assemblies.

Sometimes VS gets a bit buggy with WinForm controls and my guess this is what happened to you. Try:

  1. Run clean on the solution, restart VS, build everything and see if it helped
  2. If not, close VS, delete the .suo file, start VS, clean, rebuild

Let me know if it doesn't help

If you have placed the User Control in separate assembly, then it looks like the project dependencies are not set up correctly (Solution, properties). Check the timestamp of the DLL in the FormsProject\\bin\\Debug folder.

If this happen in 1 Project, it is certainly strange. Normally a (Re)Build should be enough. Can you build w/o errors?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM