Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A startup form has not been specified. (IDE auto-destoys my project)

Status
Not open for further replies.

ProtocolPirate

Programmer
Joined
Nov 21, 2007
Messages
104
Location
US
The VS.NET IDE destroys my projects on a regular basis, but usually I can painfully reconstruct the forms and then copy the code over to a new project. This time every new project I create promptly destroyes itself in the same manner as soon as I set up the forms and copy over the code. It DID work just *fine* until I made a few slight changes, and then it started autmoatically adding an Application.Designer.vb file and blows up on the following code:

<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.Envelope_Address_Printing.Form1
End Sub

It blows up on the assignement, with an exception of "A startup form has not been specified." Naturally the code is somehow undebuggable so I can't even view the Global and Me variables in the watch window.

Any suggestions on how I can recover this project?
 
I take that back, I can view the Me variable, but not the Global variable. Also, I tried changing the name of the form and setting it as the startup form in the Application tab of the project properties, but I get the same error.
 
OK, I take the same form that won't load and strip out the following code from the form class and suddenly the IDE can find the form again. What on Earth makes this code destroy the IDE's ability to recognize the forms presence in the project? But then the instant I pull this code out the IDE recognizes the form again?


Private Sub RadioButton_PrimaryAddress_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton_PrimaryAddress.CheckedChanged
m_bInsurerPrimaryAddress = True
Label_Name.Text = DataGridView_Insure.Item(0, m_nLocInsure).Value.ToString
Label_Addr1.Text = DataGridView_Insure.Item(9, m_nLocInsure).Value.ToString
Label_Addr2.Text = DataGridView_Insure.Item(10, m_nLocInsure).Value.ToString
Label_City.Text = DataGridView_Insure.Item(11, m_nLocInsure).Value.ToString
Label_State.Text = DataGridView_Insure.Item(12, m_nLocInsure).Value.ToString
Label_Zip.Text = DataGridView_Insure.Item(13, m_nLocInsure).Value.ToString
End Sub
 
Naturally the error message was totally misleading. When I set the radio button checked state in the form designer it was causing references to the datagridviews to be called before they were done loading.

Why on Earth this gives the error it does is quite another mystery. How utterly infuriating... I do so love it when the IDE gives such utterly misleading error messages...
 
Weird you are talking to your self ;-). Glad to have helped ;-).

Christiaan Baes
Belgium

My Blog
 
Happens sometimes. :)

-I hate Microsoft!
-Forever and always forward.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top