Results 1 to 13 of 13

Thread: VB Forms issue- Visual Studio Community Edition, 2019

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2021
    Posts
    7

    Question VB Forms issue- Visual Studio Community Edition, 2019

    I had a recent issue with my VB forms app- I've lost the Form Designer, and can't pull it up in the editor. The GUI I made for the project still pops up when I hit start though, so I know it's saved in there somewhere- any idea what could be wrong? File attached in zip.
    Attached Files Attached Files

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    36,607

    Re: VB Forms issue- Visual Studio Community Edition, 2019

    It's there. It's the Form1.designer.vb file.

    All the form designer does is provides you a GUI for manipulating that file. All the code that is in that file is what is used to show your GUI, so as long as you have the designer.vb file, then you have your form.

    Normally, if something gets corrupted in that file, when you try to show the form in the designer, you get a messy window saying that there are errors. From your description, it sounds like you are getting nothing, though. Is that right?
    My usual boring signature: Nothing

  3. #3
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    107,648

    Re: VB Forms issue- Visual Studio Community Edition, 2019

    Based on the size of your attachment, unless you have included some images, you have included the compiled binaries. That is not allowed. Make sure that you delete the obj and bin folders from your project folder before zipping a solution or project.

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    107,648

    Re: VB Forms issue- Visual Studio Community Edition, 2019

    When I've had issues like this in the past, here is something that has worked for me:

    1. Add a new project to the solution.
    2. In the Solution Explorer, drag the form to the new project to copy it.
    3. Check that the form opens as expected in the new project.
    4. Delete the original form from the original project.
    5. Drag the form from the new project back to the original.
    6. Check that the form opens as expected in the original project.
    7. Delete the new project.

    I can't guarantee that this will work but it has done for me and others on a number of occasions. If you're not using source control, which you should be, then make sure that you backup your solution first. Of course, if you were using source control then you probably wouldn't be asking about this in the first place, because you could simply revert to the last committed state that was showing this behaviour. This is an example of why even hobbyists should be using source control. Support for Azure DevOps accounts, which you can get free, are built into VS, but you can also use GitHub or various other options too.

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2021
    Posts
    7

    Re: VB Forms issue- Visual Studio Community Edition, 2019

    Yes, that's right. I can't find the GUI at all, and everything is coming up green

  6. #6

    Thread Starter
    New Member
    Join Date
    Sep 2021
    Posts
    7

    Re: VB Forms issue- Visual Studio Community Edition, 2019

    Oh- thank you. I wasn't aware of that rule, and will keep it in mind for the future

  7. #7

    Thread Starter
    New Member
    Join Date
    Sep 2021
    Posts
    7

    Re: VB Forms issue- Visual Studio Community Edition, 2019

    Sorry- I have no clue what Source Control is. And I'm not a hobbyist- I'm in a class for Visual Basic Programming, and we haven't covered that in class yet.

  8. #8

    Thread Starter
    New Member
    Join Date
    Sep 2021
    Posts
    7

    Re: VB Forms issue- Visual Studio Community Edition, 2019

    Quote Originally Posted by Shaggy Hiker View Post
    It's there. It's the Form1.designer.vb file.

    All the form designer does is provides you a GUI for manipulating that file. All the code that is in that file is what is used to show your GUI, so as long as you have the designer.vb file, then you have your form.

    Normally, if something gets corrupted in that file, when you try to show the form in the designer, you get a messy window saying that there are errors. From your description, it sounds like you are getting nothing, though. Is that right?
    Another issue I'm having- is that when I DID still have access to the GUI, the Event Handlers were being created in the design file instead of the form1.vb

  9. #9
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    36,607

    Re: VB Forms issue- Visual Studio Community Edition, 2019

    I've never seen that.

    Technically, it shouldn't matter where they are being created. They're just text files, but the designer file isn't visible by default, and can be re-written at any time by the designer...though it sounds like you won't be having THAT problem until you can get the designer back.
    My usual boring signature: Nothing

  10. #10

    Thread Starter
    New Member
    Join Date
    Sep 2021
    Posts
    7

    Re: VB Forms issue- Visual Studio Community Edition, 2019

    Quote Originally Posted by Shaggy Hiker View Post
    I've never seen that.

    Technically, it shouldn't matter where they are being created. They're just text files, but the designer file isn't visible by default, and can be re-written at any time by the designer...though it sounds like you won't be having THAT problem until you can get the designer back.
    Very true. It sucks because the project was due today and I still haven't figured it out

  11. #11
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,099

    Re: VB Forms issue- Visual Studio Community Edition, 2019

    What you can try to do is to add another form then copy the contents of the .designer file to the .designer of the newly created form.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  12. #12
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,099

    Re: VB Forms issue- Visual Studio Community Edition, 2019

    It appears your Form1 is empty, you can try adding the following code so it will be associated to its designer:

    Code:
    Public Class Form1
    
    End Class
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  13. #13

    Thread Starter
    New Member
    Join Date
    Sep 2021
    Posts
    7

    Re: VB Forms issue- Visual Studio Community Edition, 2019

    Quote Originally Posted by dee-u View Post
    It appears your Form1 is empty, you can try adding the following code so it will be associated to its designer:

    Code:
    Public Class Form1
    
    End Class
    I swear if it was that simple I might actually cry lmao

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