Results 1 to 4 of 4

Thread: [RESOLVED] How to remove an extra label showing in Form1.Designer.vb

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2016
    Posts
    10

    Resolved [RESOLVED] How to remove an extra label showing in Form1.Designer.vb

    I have extra labels created, they appear in a similar location of Form1.vb, but I cannot access the labels to remove them.
    In Form1.Designer.vb, the following appears:

    Code:
     ' Label4
            ' 
            Label4.AutoSize = True
            Label4.Location = New Point(0, 61)
            Label4.Name = "Label4"
            Label4.Size = New Size(0, 15)
            Label4.TabIndex = 11
    I wish to be able to remove this label, and am aware that I cannot modify Form1.Designer.vb itself to do this.

    What is a valid way to remove this label when I cannot access it in Form1.vb?

    Thank you for any help.

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

    Re: How to remove an extra label showing in Form1.Designer.vb

    Are you saying that one control is covering the other in the designer and you want to delete the one behind? If so, just right-click on the one in front and select Send to Back. You can also open the Document Outline window to see ever control in a hierarchical layout based on z-order, so you can change the z-order there in any way you want, plus move controls in and out of different parents. You can also just select a control in the Document Outline window and delete it there. Another option is to select a control in the drop-down at the top of the Properties window, then right-click the selection border on the form and select either Delete or Bring to Front and then delete with the keyboard. You should spend some time to acquaint yourself with what VS can do.
    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
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: How to remove an extra label showing in Form1.Designer.vb

    Having said all that, you can just modify the code in the designer code file if you want. You should generally avoid doing so though, because any mistake could cause your form to fail to render in the designer. Always make sure you have a backup to revert to. Of course, you should already be using source control so you should be able to rollback changes that way. If you're not using source control, start doing so immediately. The ability to roll back to previous states is an obvious boon but there are other advantages too.
    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

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2016
    Posts
    10

    Re: How to remove an extra label showing in Form1.Designer.vb

    Thank you very much for your help. I was able to delete the extra labels through the dropdown.
    The main reason I had issues with the labels is that I did not add Ctrl->Enter after entering my multi-line text, resulting in a blank label.

Tags for this Thread

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