what happened to my form??? Bug???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i dont understand this behaviour...

i open a vb form i created and want to save it as a new name and make some
changes

when i do (in vs2005) the original form looses its ui

whats up with that??? it turned into a straight class
 
Look at the code behind class. If you have the original and the new one both
in the same project, both code behind classes probably have the same name.
Change the new one to something else and you should once again see it as a
form.

I am not sure this is exactly whats happening in your case but it sounds
quite likely.
 
I just created a simple windows application, saved it and then opened up the
default form (Form1) created. Then i chose save as Form2. After VS saved my
changes, my project now contained form2 and form1 was no longer part of the
project. Is this the problem you are having?

If so what is happening is that you are not really adding a new form. You
are just renaming the existing one. If you want to duplicate an existing
form, the easiest way is to copy the designer.vb and .vb files and then
rename them. After they have been renamed just add them using "Add Existing
Item" to your project, change the class name and you should have both forms
in your project.

Let me know the steps you are following or you can send the project and we
should be able to identify the problem.
Regards
Parag
 
no, thats not the problem

i open form1

click on file, save as, and name it form2

both form1 and form 2 show up in the project

but the ability to go to the form designer on form1 is lost

verified same functionality using vs2003
 
HI Brad
Is this the error you are getting when you try to open the designer:

Failed to parse method 'InitializeComponent'. The parser reported the
following error 'Error HRESULT E_FAIL has been returned from a call to a COM
component.'. Please look in the Task List for potential errors.
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.OnMethodPopulateStatements(Object
sender, EventArgs e)
at System.CodeDom.CodeMemberMethod.get_Statements()
at
System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager
manager, CodeTypeDeclaration declaration)
at
System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
manager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
serializationManager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32
fReload)

Regards
Parag
 
if i right click on Form1 i no longer have the option to open it in the
designer
i can click on open and see the code only

Form1 shows up in the Solution Explorer list with a White Page Icon
it has two items underneath it, form1.designer.vb and form1.resx both with
the same icons (the white page)

Form2 shows up with the Dialog Icon, and the two files underneath
(designer.vb and resx) both have a page with writing with a blue arrow going
into it

right clicking on form2 in the se does give me the view designer option
 
HI Brad
Are you able to copy the declarations of the following files and post them?

Form1.vb
Form1.designer.vb
form2.vb
form2.designer.vb

Just the first three lines should be sufficient.
Regards
Parag
 
My forms are named TitleList and TitleList2:

TitleList.vb
#Region "Imports"
#End Region
Public Class TitleList

TitleList.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class TitleList
Inherits System.Windows.Forms.Form

TitleList2.VB
#Region "Imports"
#End Region
Public Class TitleList

TitleList2.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class TitleList
Inherits System.Windows.Forms.Form

If i rename Class to TitleList2 in the second form it doesnt fix the problem
either
 
HI Brad
I see your problem. Change the following two declarations and i feel your
problem will go away.

TitleList2.VB
#Region "Imports"
#End Region
Public Class TitleList2 ----> Changed here.

TitleList2.Designer.vb
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class TitleList2 ----> Changed here
Inherits System.Windows.Forms.Form


Let me know if that worked.
Regards
Parag
 
Would it be possible for you to attach the solution in a zip file? It sound
like this is a bug that should be reported to microsoft. I believe microsoft
connect has a site to report vs.net issues.
 
Back
Top