locked
Form1.vb[Design] missing RRS feed

  • Question

  • Currently using 2010 Visual Studio Express with VB.

    After some work with VB Project, the Form1.vb[design] has disappeared. Form1.vb is displayed and contains only a General and Declaration drop down area.

    However, when debugging, the created Form is visible.

    Only the Form1.Designer.vb code is visible within the Solution Explorer section or via the View drop down menu.

    Form2  was created alongside the Form1. Solution Explorer and View menu display both the 'View Code' and 'View Designer'. 

    In the Solution Explorer view, Form 1 is represent by an icon with small VB in the top left corner. Form2 is represented a 'View Code' icon.

    As yet have not found fix to this issue. Any suggestions welcome

    

    Wednesday, March 14, 2012 10:15 AM

Answers

  • Hi Dave Mark)

    Many thanks for comments and description of environment.

    Not sure how the Form1.Designer.vb screen became visible.

    Suggestion as provided corrected the error with the missing Form1.vb[Design] screen.

    The Form1.Designer.vb and Form1.vb were adjusted as suggested. All the user-created code was moved from the Form1.Designer.vb window into the Form1.vb window. The whole Project was then saved.

    After executing a debug and returning to the Form1.vb screen, the Form1.vb[Design] screen re-appeared. 

    Both the View drop menu and the Soution Explorer sxcreen now display the Code and Design icon.

    Many thanks again for resolving this issue. Very gratetful.

    Query will be marked as answered.


    Friday, March 16, 2012 10:01 AM
  • In order to help others looking for an answer to the same problem it helps to mark the answer, not your own post.

    • Marked as answer by Stephen Cahill Saturday, March 17, 2012 12:54 AM
    Friday, March 16, 2012 11:00 AM

All replies

  • You have deleted the Form1 class definition from Form1.vb

    Add the following:

    Public Class Form1

    End Class

    Wednesday, March 14, 2012 10:45 AM
  • Hi,

    did you toggle the 'show all files' button in the solution explorer? 

    When it is set to  'show all files', expand all nodes and look for your form1 design file.

    It probably got dragged to some other location.


    Regards, Nico

    Wednesday, March 14, 2012 10:47 AM
  • Hi Dave,

    Many thanks for review.

    Also thnik that I have have deleted text for Form accidently. Unable to determine a mehtod to recove the Form. 

    new text added to Form1.vb screen.

    Visual Studio noted this addition as a duplicate error since this Class already defined in the Form1.Designer.vb code section.

    Thursday, March 15, 2012 7:23 AM
  • Hi Nico,

    Many thaks for review and suggestions.

    Expanding files works ok as sub level are displayed OK.

    Problem is noticceable wehn moving between the Form1.vb and the Form2.vb in the Solution Explorer section.

    In this section, the Design icon appears in the Solution Explorer bar when clicking the Form2.vb icon. This Design icon disappears when clicking the Form1.vb icon.

    Thursday, March 15, 2012 7:31 AM
  • You should not modify or add to any of the code in Form1.Designer.vb.  The file is normally hidden - for a good reason.

    In Form1.Designer.vb there should be a partial class declaration

    Partial Class Form1

    Between that and the corresponding End Class is all the code which the form designer writes to create the form.

    From what you say you also have a

    Public Class FORM1
       '  some code
    End Class

    as well, which presumably you have added yourself.

    All of that should be in the Form1.vb file.

    You may have been confused by reading old web pages which refer to previous versions of VB.Net in which the designer code and your code were in the same file.  Things are different now and those sort of pages are best ignored.

    Designer code goes in Form1.Designer.vb and the file should remain hidden and untouched.  Your code goes in Form1.vb.

    Thursday, March 15, 2012 11:12 AM
  • Hi Dave Mark)

    Many thanks for comments and description of environment.

    Not sure how the Form1.Designer.vb screen became visible.

    Suggestion as provided corrected the error with the missing Form1.vb[Design] screen.

    The Form1.Designer.vb and Form1.vb were adjusted as suggested. All the user-created code was moved from the Form1.Designer.vb window into the Form1.vb window. The whole Project was then saved.

    After executing a debug and returning to the Form1.vb screen, the Form1.vb[Design] screen re-appeared. 

    Both the View drop menu and the Soution Explorer sxcreen now display the Code and Design icon.

    Many thanks again for resolving this issue. Very gratetful.

    Query will be marked as answered.


    Friday, March 16, 2012 10:01 AM
  • In order to help others looking for an answer to the same problem it helps to mark the answer, not your own post.

    • Marked as answer by Stephen Cahill Saturday, March 17, 2012 12:54 AM
    Friday, March 16, 2012 11:00 AM
  • Hi Mark,

    Marked as answered within query, and it listed as answered when viewed.

    The search engine still shows query an unanswered.

    Please advise method to mark as answered within the forum.

    Many thanks.


    • Edited by Stephen Cahill Saturday, March 17, 2012 1:06 AM correct spelling
    Saturday, March 17, 2012 1:05 AM