If there are no controls in the Tool box, check that you have all correct components for your Visual Studio.
Sounds like you are missing some components for VB.
In VS choose Tools >> Get Tools and Features.
Under the Workloads tab >> Desktop and Mobile (5)
you should need both [Net desktop developments] AND [Universal Windows Platform development] ticked.
If not you need to select them and download the missing components.
Missing design form for VB 2010
Today I was working on designing a form called frmSmokeRoads.vb and putting the final touches on the design and code. In the project directory the following three files are present: frmSmokeRoads.Designer.vb, frmSmokeRoads.resx, and frmSmokeRoads.vb. The icon for frmSmokeRoads.vb had changed in the Solution Explorer as follows:
Currently, there are no tools (text boxes, etc.) when the View Design or code when the View Code mode is selected for frmSmokeRoads.vb. I receive no error message when the program during debugging and the form appears as designed (earlier today) it when called from other portions of the program.
I would appreciate any detailed description if there is an "easy way" to recover my design and code that was in frmSmokeRoads.vb earlier today. Of course, I would like to make another change.
Thanks
Developer technologies | VB
3 answers
Sort by: Most helpful
-
Leon Stanley 96 Reputation points
2022-03-07T08:59:57.78+00:00 -
Bill J 1 Reputation point
2022-03-08T20:29:47.37+00:00 Please excuse me for being tied up with another part of life. I appreciate you trying to help me. I have been using VB for a long time (self-taught) and sorry if I am not using the proper terms. One thing that I should say before sharing the screen captures is that I was working on the form for 2 to 3 days with no problems.
In the following image, please note how the icon next to the word frmSmokeRoads no longer looks like a form. So, when I right click on frmSmokeRoads there is no option to open the View Designer (you are correct the form is empty, but really there is no form) and selecting View Code there is no code and appears as follows.:
Next, when I select "Start Debugging (F5)" (green arrow button), I can use the see my form (that I can no longer edit) from a dropdown menu. Here is the form I should have in the View Designer that is missing along with the code:
I appreciate any insight you can provide and please let me know if you need additional clarification.
Leon - I am running the 2010 version, so I could not follow the steps you had suggested.
-
Karen Payne MVP 35,586 Reputation points Volunteer Moderator
2022-03-09T02:06:37.157+00:00 Having the wrong icon in solution explorer indicates more likely than not, incorrect code in the designer file. Not sure about older Visual Studio but see if there is a
show all files
under the project menu that let's you get to this.If I were to alter the following in the designer
Partial Class Form1 Inherits System.Windows.Forms.Form
To
Partial Class Form1 'Inherits System.Windows.Forms.Form
We get
Now I'm not saying that line is bad in your form but there is a bad line someplace in the designer or a misbehaving control or component.
If you have not used source control such as a GitHub repository your choices are to a) ensure all files are present, if one is missing perhaps it's in your recycle bin? If not, and all files are there than go through the designer file looking for something that looks suspicious. Otherwise, clean and rebuild the project if all three files are there, if that fails you are royally stuck and need to recreate the form and with that this is why source control is so important which many developers feel they don't need until something like this happens.