Connecting Tech Pros Worldwide Help | Site Map

Windows controls naming convention

Lynn C
Guest
 
Posts: n/a
#1: Nov 16 '05
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
J.Marsch
Guest
 
Posts: n/a
#2: Nov 16 '05

re: Windows controls naming convention


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" <lynnc@newsgroups.nospam> wrote in message
news:5965BDF5-2446-436C-9B74-951FAE215896@microsoft.com...[color=blue]
> Hi,
>
> Does Microsoft have a listing or a guideline for naming controls in a C#[/color]
Windows application? i.e. combobox - cbx, dataset - ds[color=blue]
>
> Thanks,
> Lynn[/color]


Wavemaker
Guest
 
Posts: n/a
#3: Nov 16 '05

re: Windows controls naming convention



"J.Marsch" wrote:[color=blue]
> 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.[/color]

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.


Lynn C
Guest
 
Posts: n/a
#4: Nov 16 '05

re: Windows controls naming convention


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:
[color=blue]
>
> "J.Marsch" wrote:[color=green]
> > 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.[/color]
>
> 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.
>
>
>[/color]
Julian Nicholls
Guest
 
Posts: n/a
#5: Nov 16 '05

re: Windows controls naming convention


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" <lynnc@newsgroups.nospam> wrote in message
news:6E813D81-B010-4714-8BD3-CC4EBC50FE80@microsoft.com...[color=blue]
> Thank you for the links, but I've already visited both locations. I wanted[/color]
to locate a listing specific to C# Windows object if such a list exist or
has been release by Microsoft.[color=blue]
>[/color]


J.Marsch
Guest
 
Posts: n/a
#6: Nov 16 '05

re: Windows controls naming convention


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" <jabberdabber@BiteMeHotmail.com> wrote in message
news:3b6dnXuC55jLB07dRVn-iQ@comcast.com...[color=blue]
>
> "J.Marsch" wrote:[color=green]
> > 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.[/color]
>
> Well, there is this doc:
>
>[/color]
http://msdn.microsoft.com/library/de...onventions.asp[color=blue]
>
> 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.
>
>[/color]


Yan-Hong Huang[MSFT]
Guest
 
Posts: n/a
#7: Nov 16 '05

re: Windows controls naming convention


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.

Closed Thread