Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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...

I'm getting the hang of this now... No really I am!
Posted (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 by Reapz
I'm getting the hang of this now... No really I am!
Posted

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.

.nerd
  • *Experts*
Posted

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

"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
Posted
Yea you're right it does appear to be missing that line. I'll see what I can do with it cheers.
I'm getting the hang of this now... No really I am!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...