Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 134259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:34:52+00:00 2026-05-11T06:34:52+00:00

Is there any kind of naming convention for C# WinForms code? I Googled this

  • 0

Is there any kind of naming convention for C# WinForms code? I Googled this a bit and got nowhere fast.

I’m designing a WinForms app and the Class View is becoming tough to navigate fast, so I need to apply some standards to find things faster.

  1. New (typical) control When you drag a new control onto a form in VS, it assigns it a camel cased name, but generates a private member field. I thought the convention for private class members was camel case prefixed with an underscore?

  2. What about events & methods for controls placed on a form? Is the Studio default of ControlName_MethodName the way to go for eveything?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T06:34:53+00:00Added an answer on May 11, 2026 at 6:34 am

    No, the convention in .NET is typically to not use underscores at all. There are exceptions like in the event handlers but for most things usually there are no underscores. Other than event handlers, I do not use underscores. I use camel casing for private members and functions and pascal casing for public members (properties) and functions. However, other people have different standards. Some people like to use the C++ convention of doing _someVariable or m_someVariable. I don’t do this though.

    I rarely use hungarian, but I do use hungarian for GUI controls (So a submit button might be btnSubmit, or a list box of customers would be lstCustomers).

    As far as event handlers, you know, this is a bit of a gray area for me. If I use the Visual Studio ‘tab-complete’ way of creating event handlers, I will typically leave the name as is. This, of course, introduces the underscores. However, if I don’t, and it is not a GUI component, sometimes I just use the camelCasing. Probably for event handlers, it would be a good practice use the VS default naming scheme. I think it’s fine as long as you stay relatively consistent.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 76k
  • Answers 77k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Check out the Pinax Project. That should cover #1 (OpenID)… May 11, 2026 at 3:15 pm
  • added an answer NDoc supports this by recognising a special NamespaceDoc class located… May 11, 2026 at 3:15 pm
  • added an answer The simplest approach is to just use the java.beans API… May 11, 2026 at 3:15 pm

Related Questions

Is there any standard naming convention for VB.NET ? Based your programming experiences, would
It's helpful to name threads so one can sort out which threads are doing
I have this kind of code in some applications (from microsoft) [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage( Microsoft.Naming,
Is there a way in MySQL 5 to show only the current user's processes(queries)?

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.