|
I've asked thsi question myself before and never got an answer. I don't know offhand where to find the Hungarian list (for controls). But, if you look under Visual Basic coding conventions for VB6 in the VS help or at the MSDN Library site you should find there is a list of this sort.
Kevin
|
|
|
|
|
If the automatically assigned control names VS.NET provides are anything to go by, you would use camel casing with a unique identifier at the end, e.g.:
System.Windows.Forms.TextBox textBox1;
System.Windows.Forms.TextBox textBoxUserName;
This is the way I do it in .net, simply because it's the way the IDE does it, and I'd hope the IDE follows the accepted conventions
|
|
|
|
|
To get the hungarian notation list:
Run VB6
Pull up Help
Goto Index (or is it Search) and enter 'Naming Conventions'
This should point you to the Naming Conventions page which contains Hungarian Notation for all variables, forms, controls, etc.
In our group, we have chosen to move completely to the naming conventions specified in the CLS. So everything, private or public, follows the CLS nameing standards. Methods, classes and namespaces are Proper Case. Parameters, properties, variables are camelCased. I believe that the only exceptions we have made so far are with the rare fat client code and the form itself is still named frmFormName.
---------------------------------------------
Once I thought I was wrong but I was happy to discover that was a mistake.
Condor
|
|
|
|
|
so your using the camel and pascal notations but tell me what are you using for controls?
hungarian?
if not then tell me what notation are you using for controls and give me some examples too...
thanks!
|
|
|
|
|
Looking through my code, I have turned to using pascal notation for all of my controls. So for example, most pages I build has a line for display of error messages. That label is named ErrorMessage. A combobox which allows the choices for descriptions of a project phase is named ProjectPhaseChoices. It also helps clarify the code a little bit. For example:
lifeCycle += 2; vs.
LifeCycleChoice.SelectedItem = 1;
It is obvious which is a variable. If Microsoft allowed the original notation for controls (eg: LifeCycleChoice="Unit Testing"; ) you would have a real hard time short of mouse-floating to determine if you are working with a control or an internal variable. Fortunately, you are forced into explicitely naming the property within the control object. But it is all a matter of personal choice. I name all of my objects in Pascal, so it makes sense that the controls also be named in Pascal as well since both are just objects.
---------------------------------------------
Once I thought I was wrong but I was happy to discover that was a mistake.
Condor
|
|
|
|
|
I just type whatever comes to mind first If I remeber to keep the shift in, it capitalizes, else all variables (aka objects, controls, instances) stay lowercase. Intellisense does the rest.
"There are no stupid question's, just stupid people."
|
|
|
|
|
leppie wrote:
I just type whatever comes to mind first
At times I think that is one of the best ways to do it. Not because it makes code any more readable (it doesn't) but because of C# having the ^#*&^@( case sensitivity. So frequently I screw up a namespace or object reference because of case. Very frustrating. But at the same time, is doing code in all lower case any different from the original mainframe days when code was all upper case??????
---------------------------------------------
Once I thought I was wrong but I was happy to discover that was a mistake.
Condor
|
|
|
|
|
I must say my public members allways looks nice
"There are no stupid question's, just stupid people."
|
|
|
|
|
leppie wrote:
I must say my public members allways looks nice
are we still talking C# code? And just how visible are your public members? ...and what happens if someone tries to overload your public members? ...and what about your private members? The mind boggles at the possibilities of double entendres. Hmmmm a new topic for the conversation board....program terminology turned into a double entendre. (however entendre is spelled....)
_____________________________________________
I have a tendancy to where my mind on my sleeve I have a habit of losing my shirt...
|
|
|
|
|
I ussually have a member name that is Capitalised for a public member, and the same name in lowercase for the private member .
"There are no stupid question's, just stupid people."
|
|
|
|
|
leppie wrote:
I ussually have a member name that is Capitalised for a public member, and the same name in lowercase for the private member .
By those development standards you are CLS compliant!
I tend to lean towards consistant private and public member names with proper casing, but again once you get into private members it leans towards personal taste. In our company it also gets driven by internal standards ... consistancy = easy support. As to proper case everywhere I don't mind doing proper case everywhere, but I also type 60 words/per/minute which usually makes the cap typing irrelavent to me.
My mom made me take typing in high school .... little did she know how it would actually help my carreer now!!! The only thing I remember about the class was the day the teacher had the class do races against her. She kept eliminating people each round. I was one of only two boys in the class, and I was THE ONE to end up going head-to-head against her in the end. She won the race, BTW, with 62 wpm against my 60 wpm; I had two typing errors in the paragraph that counted against me.
_____________________________________________
I have a tendancy to where my mind on my sleeve I have a habit of losing my shirt...
|
|
|
|
|
your doing the wise thing....but i am actually caught in no mans land...actually the thing is that i have to work in team and i have to sort out a convention within .NET that we all can apply...if you ask me if i let everyone apply pascal for controls it would be very hard for anyone of us to judge what is control and what is a variable as you said and as i know my team....it would be hard to read the code!
so what i have thought now is to use hungarian notation for controls and pascal and camel for everything else in .NET what do you think?
|
|
|
|
|
I want to do word programming.I added the word.olb file using the option add ref. Now all the interfaces,classes mathods for doing word programming are available.
Questions is i want description of methods which is not available in the IDE? How can i get this.
/| )' _ _ _ /_| / _ _ _/
/ |//_) (// ( |/)//)(- ( /
|
|
|
|
|
Nisar Ahmed wrote:
Questions is i want description of methods which is not available in the IDE?
let them appear with appropriate casting.
If you search this forum with "Word" (and google with "Word.Application"), you should fall into interesting stuff.
How low can you go ? (enculage MS)
|
|
|
|
|
how to creat a directory at a perticuler path?
plz tell code for that i will be very thank full.
r00d0034@yahoo.com
|
|
|
|
|
Directory.CreateDirectory(path);
|
|
|
|
|
Using the System.IO namespace it is as simple as the static Directory methods
<br />
...<br />
Directory.CreateDirectory("c:\\myNewDirectory");<br />
...<br />
if you need a reference to the directory you can create a new DirectoryInfo instance.
<br />
...<br />
DirectoryInfo myDir = new DirectoryInfo("c:\\myNewDirectory");<br />
...<br />
chris
|
|
|
|
|
oops forgot something. To create the directory on the drive using the DirectoryInfo class you need to add the an extra line of code so the second example should be.
<br />
...<br />
DirectoryInfo myDir = new DirectoryInfo("c:\\myNewDir");<br />
myDir.Create();<br />
chris
|
|
|
|
|
Please teach people to use @"c:\myNewDir". Let's get rid of that nasty thing!
How low can you go ? (enculage MS)
|
|
|
|
|
Amen! I always use string literals when I have a backslash. It seems stupid to do a double backslash.
Norm Almond: I seen some GUI's in my life but WTF is this mess
Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough
Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children
Leppie:My sister is 25
-Norm on the MailMagic GUI
|
|
|
|
|
David Stone wrote:
I always use string literals when I have a backslash.
I try to as well, but there are times when you want a tab, line feed, new line, or quote embedded in the string. The only clean way to put those in a string is to use the \t, \r, \n, and \" escape sequences (not sure of the real name ).
James
Sig code stolen from David Wulff
|
|
|
|
|
Well yeah, but those are string format modifiers...or whatever they're called. I'm cool with those. But when it's a path, I use @.
Norm Almond: I seen some GUI's in my life but WTF is this mess
Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough
Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children
Leppie:My sister is 25
-Norm on the MailMagic GUI
|
|
|
|
|
__Stephane Rodriguez__ wrote:
Please teach people to use @"c:\myNewDir". Let's get rid of that nasty thing!
"c:/myNewDir"
"There are no stupid question's, just stupid people."
|
|
|
|
|
leppie, you're using UNIX?
Norm Almond: I seen some GUI's in my life but WTF is this mess
Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough
Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children
Leppie:My sister is 25
-Norm on the MailMagic GUI
|
|
|
|
|
Nope, just Windows I guess MS realized how stupid \'s are for directories and decided to lets us use / as well. Try it!
@"c:\work" == "c:\\work" == "c:/work"
"There are no stupid question's, just stupid people."
|
|
|
|