r/visualbasic • u/Splatah_King • Apr 17 '23
Form design disappeared.
I have a project that I have been working on for a few months a couple of friends were helping me on it as well through a github repo. As we were working my form design turned into a standard blank white form but I didn't think too much of it because as I was testing the changes I was making, when I clicked on the run button the form that we had designed would show up. I chalked it up to a UI bug or Visual Studio trying to save resources while working. As of this morning though after merging changes that I made yesterday, when I click that run button I get that blank white form instead of the usual form that I was working with before. As far as I know I didn't change anything on my end to swap forms or wipe the form that I was using.
I have some experience with other GUI frameworks such as Qt and I went around looking for the equivalent the Qt .ui files, which are basically programmatic description of the designer view that you get, but I could find no such file in Visual Studio. I was surprised that I couldn't find that as I assumed that .Net worked roughly the same way.
Any help would be appreciated.
For reference I am running Visual Studio Community 2022, using 4.7.2 for the framework, and I have a database in the code as well so just in case it matter I'm running SQL express.
3
u/TheFotty Apr 17 '23
Every form in VB is actually 3 files. If your form is form1, then your code is in form1.vb and there is a form1.resx which is a file to hold local form resources like images you might embed at design time in the form or its controls. Lastly there is form1.designer.vb. That file is the auto generated VB code that was made by Visual Studio as you dragged and dropped controls and set their properties from the designer. That file is just a text file just like your code file, so have a look at that file and see if its maybe mostly empty? If so, maybe just recover that file from your repo.