Click here to Skip to main content
15,882,113 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionSimple question: why does Visual Studio "freak out" when changing Form1 name to something different Pin
lewist577-Mar-22 13:57
lewist577-Mar-22 13:57 
AnswerRe: Simple question: why does Visual Studio "freak out" when changing Form1 name to something different Pin
Richard MacCutchan7-Mar-22 21:21
mveRichard MacCutchan7-Mar-22 21:21 
QuestionRe: Simple question: why does Visual Studio "freak out" when changing Form1 name to something different Pin
CHill607-Mar-22 21:22
mveCHill607-Mar-22 21:22 
AnswerRe: Simple question: why does Visual Studio "freak out" when changing Form1 name to something different Pin
lewist578-Mar-22 11:34
lewist578-Mar-22 11:34 
GeneralRe: Simple question: why does Visual Studio "freak out" when changing Form1 name to something different Pin
Dave Kreskowiak8-Mar-22 15:57
mveDave Kreskowiak8-Mar-22 15:57 
GeneralRe: Simple question: why does Visual Studio "freak out" when changing Form1 name to something different Pin
lewist579-Mar-22 8:17
lewist579-Mar-22 8:17 
GeneralRe: Simple question: why does Visual Studio "freak out" when changing Form1 name to something different Pin
Dave Kreskowiak9-Mar-22 9:11
mveDave Kreskowiak9-Mar-22 9:11 
GeneralRe: Simple question: why does Visual Studio "freak out" when changing Form1 name to something different Pin
lewist579-Mar-22 13:57
lewist579-Mar-22 13:57 
"Well, something's going on that isn't normal."

and hence the title of the post.

Going to the application tab and selecting Form1 as the startup object, compiling, and then changing the form name in Solution Explorer allowed compilation without an error.

However, I will note that after changing the form name from Form1 to frmMain as above, in the application tab/startup object, it is still "Form1" and not "frmMain". And while the form name in Solution Explorer is "frmMain", when you click on the form and look at Properties, it is still "Form1"

My Win10 pc and VS are both up to date.

Now here is where it gets even more interesting. Once again start a new project, VB/windows form/desktop/,NET 6, let the solution come up with Form1. Go to Project, Add form, and add a new form. At this time you can call it "frmMain" when it is added. Then go to Solution Explorer, select Form1 and delete it. So at this point, Form1 is gone, and only frmMain remains. Go to application tab/startup and select frmMain as the startup object. Build the solution and then you get:

Error BC30456 'Form1' is not a member of 'test6'.

Now VS is throwing errors on a "form" that has been deleted from the solution.

So I know there are work arounds, but the (somewhat rhetorical) question is: why doesn't VS automatically update all references in the solution when a form's name is changed/deleted?

modified 9-Mar-22 20:22pm.

GeneralRe: Simple question: why does Visual Studio "freak out" when changing Form1 name to something different Pin
Dave Kreskowiak9-Mar-22 14:59
mveDave Kreskowiak9-Mar-22 14:59 
GeneralRe: Simple question: why does Visual Studio "freak out" when changing Form1 name to something different Pin
Richard MacCutchan8-Mar-22 22:14
mveRichard MacCutchan8-Mar-22 22:14 
GeneralRe: Simple question: why does Visual Studio "freak out" when changing Form1 name to something different Pin
lewist579-Mar-22 8:10
lewist579-Mar-22 8:10 
GeneralRe: Simple question: why does Visual Studio "freak out" when changing Form1 name to something different Pin
Richard MacCutchan9-Mar-22 21:37
mveRichard MacCutchan9-Mar-22 21:37 
GeneralRe: Simple question: why does Visual Studio "freak out" when changing Form1 name to something different Pin
Slow Eddie20-May-22 8:21
professionalSlow Eddie20-May-22 8:21 
Questionspur gear Pin
Member 155582647-Mar-22 9:29
Member 155582647-Mar-22 9:29 
AnswerRe: spur gear Pin
Dave Kreskowiak7-Mar-22 10:23
mveDave Kreskowiak7-Mar-22 10:23 
SuggestionRe: spur gear Pin
CHill607-Mar-22 21:27
mveCHill607-Mar-22 21:27 
GeneralRe: spur gear Pin
Member 155582648-Mar-22 11:16
Member 155582648-Mar-22 11:16 
QuestionRe: spur gear Pin
CHill608-Mar-22 21:31
mveCHill608-Mar-22 21:31 
GeneralRe: spur gear Pin
Mycroft Holmes13-Mar-22 12:15
professionalMycroft Holmes13-Mar-22 12:15 
GeneralRe: spur gear Pin
Slow Eddie20-May-22 8:22
professionalSlow Eddie20-May-22 8:22 
Questionclose app without having form in foreground Pin
Benjamindh3-Mar-22 7:05
Benjamindh3-Mar-22 7:05 
AnswerRe: close app without having form in foreground Pin
Richard Andrew x643-Mar-22 9:11
professionalRichard Andrew x643-Mar-22 9:11 
GeneralRe: close app without having form in foreground Pin
Benjamindh3-Mar-22 9:39
Benjamindh3-Mar-22 9:39 
GeneralRe: close app without having form in foreground Pin
Dave Kreskowiak4-Mar-22 11:41
mveDave Kreskowiak4-Mar-22 11:41 
GeneralRe: close app without having form in foreground Pin
Benjamindh11-Mar-22 3:05
Benjamindh11-Mar-22 3:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.