Reapz Posted March 12, 2003 Posted March 12, 2003 I started a VB.NET project a while ago and had got quite far into it. I've recently reinstalled my system and yesterday I got around to reinstalling VS.NET. The project was saved into My Documents as per default which is located on a backup drive. When I opened the project and opened up the 2 main forms I found that all the code was intact, one of the forms was intact but the controls on the other form have disappeared. I'm sure I have installed and referenced all ActiveX controls that I was using before. I hope one of you guys has a solution because the form is quite complex and it will take bloody ages to replace all the controls. Thanks in advance... Quote I'm getting the hang of this now... No really I am!
Reapz Posted March 13, 2003 Author Posted March 13, 2003 (edited) Oh and incidentally, there are no error messages or any indication of what the problem is and also I have tried to replace a couple of the controls and it won't let me because they already exist. I just can't see them!!! Edited March 13, 2003 by Reapz Quote I'm getting the hang of this now... No really I am!
Heiko Posted March 13, 2003 Posted March 13, 2003 Look at the form that works. Look ar the generated code. There you'll have: Declaration of the controls Instantiation (New() ...) of the controls Initial setting of controls' properties (Name. Location etc....) Adding of controls to containers (pnlMainPanel.AddRange ....) Now look at the form where the controls have disappeared and try to figure out what is missing. My two guesses are ... a) either negative values in the "location property" or b) they are no longer added to their respective containers. Things aren't that difficult. Quote .nerd
a_jam_sandwich Posted March 13, 2003 Posted March 13, 2003 RE-BUILD a few times worked for me Oh and once thats done close .NET then reopen your project should work Quote Code today gone tomorrow!
*Experts* Nerseus Posted March 13, 2003 *Experts* Posted March 13, 2003 This has been covered a few times - maybe we should add it to a FAQ (when we get one). Check out your InitializeComponent function. Look at the VERY bottom where it sets properties for the form. It's probably missing the line: this.Controls.AddRange(...) If it is, it's probably missing a bunch of other lines as well. Sometimes .NET (maybe with SourceSafe, maybe not) just deletes those lines. I've seen it happen on a number of machines but never reproducable. Check source safe if you have it, otherwise you'll have to manually add the controls back to the form's collection. -Ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Reapz Posted March 13, 2003 Author Posted March 13, 2003 Yea you're right it does appear to be missing that line. I'll see what I can do with it cheers. Quote I'm getting the hang of this now... No really I am!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.