Results 1 to 9 of 9

Thread: Deleting the Public Class statement

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    321

    Deleting the Public Class statement

    Hi All

    I have a form called 'Form1' in my .NET Project.

    When I double clicked the form it went into the code editor.

    However, I accidently deleted the statement

    Code:
    Public Class Form1
    
    
    End Class
    how can i get this code back?

    Thanks

  2. #2
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: Deleting the Public Class statement

    There is a staggeringly obvious answer to this question isn't there?

  3. #3
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: Deleting the Public Class statement

    As ten minutes has passed and then penny doesn't appear to have dropped I'll help out.

    I can think of three ways of doing it...

    i) Either press CTRL+Z or select undo from the Edit Menu
    ii) Copy and paste the two lines from your code snippets - the 1st one put at the top of the code editor, the 2nd one at the bottom
    iii) Type the two lines from your code snippets - type the 1st one at the top of the code editor, type the 2nd one at the bottom

    Or is this a trick question?

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    321

    Re: Deleting the Public Class statement

    Quote Originally Posted by keystone_paul View Post
    As ten minutes has passed and then penny doesn't appear to have dropped I'll help out.

    I can think of three ways of doing it...

    i) Either press CTRL+Z or select undo from the Edit Menu
    ii) Copy and paste the two lines from your code snippets - the 1st one put at the top of the code editor, the 2nd one at the bottom
    iii) Type the two lines from your code snippets - type the 1st one at the top of the code editor, type the 2nd one at the bottom

    Or is this a trick question?
    Thanks - Thats Great

  5. #5
    Frenzied Member
    Join Date
    Jul 2009
    Posts
    1,103

    Re: Deleting the Public Class statement

    you are right shamas21 thats really great..........
    if i say that i am trying to write a .net code in a notepad and trying to compile the code then it will be great also......Is nt it?

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    321

    Re: Deleting the Public Class statement

    Quote Originally Posted by gautamshaw View Post
    you are right shamas21 thats really great..........
    if i say that i am trying to write a .net code in a notepad and trying to compile the code then it will be great also......Is nt it?
    Guys - One more question relating to my Form.

    The top half of my form has a list box and the bottom half of my form has a listbox. Both listboxes are quite tall in height and cant fit both on my form.

    An alternative im looking for is, is there some sort of divider that i can put in the middle of the form where by i can increase the view of the bottom half of my form when i drag the divider up, or something alike?

    Thanks

  7. #7
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: Deleting the Public Class statement

    If you look in the toolbox in the "containers" section there is a splitcontainer which creates 2 panels and a draggable divider.

    By default this has 2 vertical panels which can have adjustable widths, however you can use its "orientation" property to change this to horizontal panels where you can change the height.

  8. #8
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Deleting the Public Class statement

    Quote Originally Posted by Shamas21 View Post
    Hi All

    I have a form called 'Form1' in my .NET Project.

    When I double clicked the form it went into the code editor.

    However, I accidently deleted the statement

    Code:
    Public Class Form1
    
    
    End Class
    how can i get this code back?

    Thanks
    If you havn't closed the editor yet, pressing CTRL+Z (undo operation) several times should bring it back.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    321

    Re: Deleting the Public Class statement

    Thanks Guys.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width