Results 1 to 3 of 3

Thread: [RESOLVED] Problem with deleted control

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2007
    Location
    North Texas
    Posts
    70

    Resolved [RESOLVED] Problem with deleted control

    In the windows form designer, I added a StatusStrip control, made some changes to adding items and changed the names of the items to names I would recognize, for instance I changed "ToolStripStatusLabel3" to "lblMode".

    All was fine until I inadvertenly deleted the StatusStrip. Now when I add it back to the form and try to change the name I get an error saying that the name "lblMode" is already in use. And sure enough it is listed in the items of the properties window, but not dislayed anywhere.

    I am not sure how to resolve this. I know there is a window, I think its called "Project Designer" or something similar that is code where controls get added but I CANNOT find this window to view the code.

    Any Help would be great!

    Thanks,
    David

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Problem with deleted control

    Something has gone wrong because, when you deleted the parent strip, the children should have been deleted too.

    You will need to open the designer code file and edit it by hand. You must be careful because, if you do the wrong thing, you may render your form unusable. For that reason, you should create a backup of your project first.

    Open the Solution Explorer, select your project and then click the Show All Files button at the top. Now expand the node for your form and then double-click the designer.vb file under it. You should now be looking at the code generated by the designer in response to your visual design actions. Find where this 'lblMode' variable is declared and delete it. That should then throw up a bunch of errors where 'lblMode' is used. Delete them too. Do the same for any other children of the StatusStrip that should also have been deleted. You should now be good to go.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2007
    Location
    North Texas
    Posts
    70

    Re: Problem with deleted control

    AWESOME! Thank you so much!
    Thanks,
    David

    How much deeper would the ocean be if sponges didn't grow there?

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