C# Function Seperator

Posted on 2011-05-06
Last Modified: 2013-12-16
I'm switching from VB.NET to C# as my primary development platform.

The one thing I miss is the line that separates the functions in the VB IDE.  I can't find any way to have this line displayed in C#, is there a way to do so?

Image Attached:

Question by:MCIM
    LVL 43

    Expert Comment

    Just leave some blank lines eg.

    void Foo()

    void Bar()

    Accepted Solution

    me neither know. I use region for encapsulate functions.

    like this:

    #region ** tools ************************************************************************

    private void sumSomething()

    LVL 43

    Assisted Solution

    ps.  As far as I know it doesn't exist as such in displaying C# files.
    LVL 16

    Expert Comment

    by:Rose Babu

    Why do you need the line separation on C# code? it is not necessary in your case.

    By the way you are converting the application, you should worry about the code conversion only.

    The line separator will come for VB applications NOT for C# application. and this will not make any error/issue on building/running application.

    so just go-ahead on your code conversion and run the application successfully.

    Happy Programming.


    Author Closing Comment

    Thanks for the responses.  

    I want the line separation because I find it useful.  I'm not converting any applications, I just included the image as an example of what I was looking for.

    I guess I'll try to create a code snippet to insert between functions, putting multiple blank lines will limit the amount of code that can be displayed on the screen - increasing the need to scroll.

    I like the #region option as well.. thanks again!
    LVL 43

    Expert Comment

    You could also just do

    the // makes it a comment and the rest of the line is ignored by the compiler.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    In my previous article ( we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now