473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Windows controls naming convention

Hi,

Does Microsoft have a listing or a guideline for naming controls in a C# Windows application? i.e. combobox - cbx, dataset - ds

Thanks,
Lynn
Nov 16 '05 #1
6 16691
Actually, they don't recommend Hungarian notation. On forms, I see alot of
things like "OkButton", etc. I thought that there was a doc on this on the
msdn site. I could only seem to be able to dig up right now are some
guidelines for class library developers. I say "only", but there's a lot of
good stuff here (watch for the word-wrap):
http://msdn.microsoft.com/library/de...guidelines.asp

"Lynn C" <ly***@newsgroups.nospam> wrote in message
news:59**********************************@microsof t.com...
Hi,

Does Microsoft have a listing or a guideline for naming controls in a C# Windows application? i.e. combobox - cbx, dataset - ds
Thanks,
Lynn

Nov 16 '05 #2

"J.Marsch" wrote:
Actually, they don't recommend Hungarian notation.
On forms, I see alot of things like "OkButton",
etc. I thought that there was a doc on this on the
msdn site.


Well, there is this doc:

http://msdn.microsoft.com/library/de...onventions.asp

It applies to VB pre .NET, apparently. I've adapted it for my C#
code. Controls are the only place where I use anything like
Hungarian notation, and I have found it useful to an extent. For
example, instead of fileOpenMenuItem, I would use mnuFileOpen.
However, I do have some doubt about this practice, and I would be
interested in opinions from other C# programmers.
Nov 16 '05 #3
Thank you for the links, but I've already visited both locations. I wanted to locate a listing specific to C# Windows object if such a list exist or has been release by Microsoft.

"Wavemaker" wrote:

"J.Marsch" wrote:
Actually, they don't recommend Hungarian notation.
On forms, I see alot of things like "OkButton",
etc. I thought that there was a doc on this on the
msdn site.


Well, there is this doc:

http://msdn.microsoft.com/library/de...onventions.asp

It applies to VB pre .NET, apparently. I've adapted it for my C#
code. Controls are the only place where I use anything like
Hungarian notation, and I have found it useful to an extent. For
example, instead of fileOpenMenuItem, I would use mnuFileOpen.
However, I do have some doubt about this practice, and I would be
interested in opinions from other C# programmers.

Nov 16 '05 #4
Well, the listing on the VB page is a Microsoft list, but the point is that
there isn't a list any more because you're not supposed to use Hungarian
now.

All the Best
Julian N.

"Lynn C" <ly***@newsgroups.nospam> wrote in message
news:6E**********************************@microsof t.com...
Thank you for the links, but I've already visited both locations. I wanted to locate a listing specific to C# Windows object if such a list exist or
has been release by Microsoft.

Nov 16 '05 #5
I had a very strong habit of doing that when I started with C# (from my days
with Delphi). I've been trying to "cross over" and start using the
<nameofthe thing>ControlClassName pattern: OkButton, as this is the coding
standard where I work. However, for controls, I'm finding that I like it
better when the typename comes first (as with hungarian notation). Reason:
if you pull up intellisense with this., you see all of the controls on the
form sorted by type. I kind of like that organization.

As it is, I'm sticking to our standard, even though I like hungarian names
for the controls. Because, as Red Foreman once said: "If we didn't have
laws, we'd all still be living in trees, throwing our feces at each other.".
<g>

"Wavemaker" <ja**********@BiteMeHotmail.com> wrote in message
news:3b********************@comcast.com...

"J.Marsch" wrote:
Actually, they don't recommend Hungarian notation.
On forms, I see alot of things like "OkButton",
etc. I thought that there was a doc on this on the
msdn site.
Well, there is this doc:

http://msdn.microsoft.com/library/de...onventions.asp
It applies to VB pre .NET, apparently. I've adapted it for my C#
code. Controls are the only place where I use anything like
Hungarian notation, and I have found it useful to an extent. For
example, instead of fileOpenMenuItem, I would use mnuFileOpen.
However, I do have some doubt about this practice, and I would be
interested in opinions from other C# programmers.

Nov 16 '05 #6
Hello,

This KB artilce may be helpful to you. It gives you the naming conventions used by Microsoft Consulting Services (MCS).

"INFO: Microsoft Consulting Services Naming Conventions for Visual Basic"
http://support.microsoft.com/?id=110264

Here is another useful link that I got:
http://www.akadia.com/services/naming_conventions.html

Hope that helps.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Lalit | last post by:
Hi Friends, We are defining coding standards for our company. In MSDN i have seen that hungarian notation will not be used in naming of variables etc. What about the controls ? Should we...
27
by: Derek | last post by:
The company where I work uses a naming convention that I have never used before. They use mixed-case letters for public member functions, but lower-case with underscores for the rest, like this:...
7
by: cmiddlebrook | last post by:
Hi there, I keep finding myself getting inconsistent with naming conventions for things like member variables, class names etc and I just want to find something that suits me and stick to it. I...
14
by: 42 | last post by:
Hi, Stupid question: I keep bumping into the desire to create classes and properties with the same name and the current favored naming conventions aren't automatically differentiating them......
0
by: Carl Colijn | last post by:
Hi all, Disclaimer: before I might trigger your "let's start a holy war!" button, I'd like to say I'm not intended to; I just post this message to get some input and not to promote "Yet Another...
9
by: kevininstructor | last post by:
Greetings, I am in the process of creating naming conventions for VB.NET controls i.e. CheckBox -> chkShowThisOnStartup ListBoxt -> lstSomeList What I am looking for other developers...
6
by: dm1608 | last post by:
I'm relatively new to ASP.NET 2.0 and am struggling with trying to find the best naming convention for the BAL and DAL objects within my database. Does anyone have any recommendations or best...
114
by: Jonathan Wood | last post by:
I was just wondering what naming convention most of you use for class variables. Underscore, "m_" prefix, camel case, capitalized, etc? Has one style emerged as the most popular? Thanks for...
35
by: Smithers | last post by:
Is it common practise to begin the name of form classes with "frm" (e.g., frmOneForm, frmAnotherForm). Or is that generally considered an outdated convention? If not "frm" what is a common or...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.