Results 1 to 6 of 6

Thread: Lost code, references still there???

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2001
    Location
    Fort Lauderdale, FL
    Posts
    98

    Unhappy Lost code, references still there???

    OK, this stinks. I lost about 85% of my project. I don't know how, but most of my dropdowns, labels, buttons and text fields are gone along with the code that was attached to them.

    Now, after I beat myself up for not using SourceSafe I sat down to start redesigning my app. As I drew the first dropdown and renamed it a message box popped up and informed that I could have 2 objects with the same name.

    When I look at the code I see Protected WithEvents...and the names of all the controls I lost (and some that are still their)

    I don't remember if this was there before (I'm not familiar with .net and kinda ignore all the code it enters by itself, hence my problem). Should I just delete all of this WithEvents stuff or should I just scrap the whole project and start brand new?

    Thanks!!!

  2. #2
    Hyperactive Member
    Join Date
    Feb 2002
    Posts
    261

    Re: Lost code, references still there???

    Originally posted by Criki
    OK, this stinks. I lost about 85% of my project. I don't know how, but most of my dropdowns, labels, buttons and text fields are gone along with the code that was attached to them.

    Now, after I beat myself up for not using SourceSafe I sat down to start redesigning my app. As I drew the first dropdown and renamed it a message box popped up and informed that I could have 2 objects with the same name.

    When I look at the code I see Protected WithEvents...and the names of all the controls I lost (and some that are still their)

    I don't remember if this was there before (I'm not familiar with .net and kinda ignore all the code it enters by itself, hence my problem). Should I just delete all of this WithEvents stuff or should I just scrap the whole project and start brand new?

    Thanks!!!
    All of those WithEvents stuff, are your controls. All of the code in the 'Windows Forms Designer Generated Code' area is real VB.NET code that you can write and modify yourself if you want, not some IDE-dependant stuff.

    All of those declarations that have 'Withevents', those are nothing more than normal variable declarations that represent all of your controls on the form. If those declarations are still there, you still have your contros. My guess is that they've been moved off of the edge of the form. Check the form's properties window, and there should be a drop-down list box that would list all of the controls on your form. If the controls are listed, maybe you can just expand the form so you can see your controls, then drag them all at once to where they should be.

    Just a guess, but from what your telling me, the controls are still there. If thats the case, then there isn't much that needs to be done to fix this problem.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2001
    Location
    Fort Lauderdale, FL
    Posts
    98
    I checked the properties dropdown, and no such luck.
    The WithEvents statements show quite a few more objects than the property dd box.

    Thanks though, I was so hoping they were just moved.

  4. #4
    Hyperactive Member
    Join Date
    Feb 2002
    Posts
    261
    Your controls are still there if the declarations are still there.

    Hmm, maybe if you could post the 'Windows Forms Designer Generated Code' section of your code, then we might be able to help you out further.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2001
    Location
    Fort Lauderdale, FL
    Posts
    98
    I don't know exactly what it is that you want me to copy. Is it just the VB code that is automatically entered?

    FYI: When I look in the Object Browser it's all there, also.

    It's craziness.

  6. #6
    Hyperactive Member
    Join Date
    Feb 2002
    Posts
    261
    Originally posted by Criki
    I don't know exactly what it is that you want me to copy. Is it just the VB code that is automatically entered?

    FYI: When I look in the Object Browser it's all there, also.

    It's craziness.
    Yes, copy all of the code in the 'Windows Forms Designer Generated Code' region and post it here (post it between the CODE tags, see the vB Code help link when you reply).

    As I've said, the code in that region really isn't anything special. All of the controls on your form are just variables. These variables are declared and initialized in the Windows Form Designer Generated Code region. If you expand that region, and post the code here, I'll be able to know all of the controls on your form and their properties, and therefore be able to tell you whats going on and how to fix your problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width