473,398 Members | 2,427 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,398 software developers and data experts.

multi control naming convention

Hi,
I'm new to C# and .NET. I'm a first time user of Visual C# 2005 Express and
have a very basic question. I've looked at several links and lots of docs but
can't find any tips on naming multiple controls used for the same purpose on
different Forms.

Specifically, I have several identical TextBox controls each on a different
TabPage. The textboxes display the same variable content on each TabPage. An
example might be display of name and ssn on each page of a personnel form. Is
there a naming convention for naming each TextBox control? I assumed the
container name could be used but I see that is a no-no. Of course, txtName1,
txtName2 is possible but isn't very meaningful.

Also, I don't like to waste others time so if there is a more appropriate
forum/NG for us C# newbies, a link will be appreciated.

Thanks for the help and and Best Regards,
Sturdy
Apr 25 '06 #1
4 1761
There is no naming convention for such a very special case which should
indeed be avoided.
If there are identical things on different tabpages make them in one
usercontrol and put that in the different tabpages.
"Sturdy" <St****@discussions.microsoft.com> schrieb im Newsbeitrag
news:0F**********************************@microsof t.com...
Hi,
I'm new to C# and .NET. I'm a first time user of Visual C# 2005 Express
and
have a very basic question. I've looked at several links and lots of docs
but
can't find any tips on naming multiple controls used for the same purpose
on
different Forms.

Specifically, I have several identical TextBox controls each on a
different
TabPage. The textboxes display the same variable content on each TabPage.
An
example might be display of name and ssn on each page of a personnel form.
Is
there a naming convention for naming each TextBox control? I assumed the
container name could be used but I see that is a no-no. Of course,
txtName1,
txtName2 is possible but isn't very meaningful.

Also, I don't like to waste others time so if there is a more appropriate
forum/NG for us C# newbies, a link will be appreciated.

Thanks for the help and and Best Regards,
Sturdy

Apr 26 '06 #2
Cody,

Thanks for the response...I said I was a newby. ;) I had not yet discovered
the usercontrol. Seems a much better solution once I figure out the details.

Thanks again,
Sturdy
"cody" wrote:
There is no naming convention for such a very special case which should
indeed be avoided.
If there are identical things on different tabpages make them in one
usercontrol and put that in the different tabpages.
"Sturdy" <St****@discussions.microsoft.com> schrieb im Newsbeitrag
news:0F**********************************@microsof t.com...
Hi,
I'm new to C# and .NET. I'm a first time user of Visual C# 2005 Express
and
have a very basic question. I've looked at several links and lots of docs
but
can't find any tips on naming multiple controls used for the same purpose
on
different Forms.

Specifically, I have several identical TextBox controls each on a
different
TabPage. The textboxes display the same variable content on each TabPage.
An
example might be display of name and ssn on each page of a personnel form.
Is
there a naming convention for naming each TextBox control? I assumed the
container name could be used but I see that is a no-no. Of course,
txtName1,
txtName2 is possible but isn't very meaningful.

Also, I don't like to waste others time so if there is a more appropriate
forum/NG for us C# newbies, a link will be appreciated.

Thanks for the help and and Best Regards,
Sturdy


Apr 26 '06 #3
Hi Cody,

Here is a good link to some coding conventions:
http://weblogs.asp.net/scottdockendo...26/361020.aspx

What is the purpose of your form/tabpages/Application? I usually use the
name provided by visual studio for a control, i then remove the numbered
portion and replace it with some meaningul text that helps describe the
purpose of the control.

If the controls are of such a nature that meaningful information can not be
attached to it you should generate the controls dynamically to safe yourself
some effort.

If you need some examples on how to create controls dynamivcally give me a
shout!

I was pleased to discover that Visual Studio 2005 professional has the
capability to check for naming conventions & other coding best practices.

http://msdn2.microsoft.com/en-us/lib...t8(VS.80).aspx
--
In Adversity lies opportunity! - Anonymous
"Sturdy" wrote:
Cody,

Thanks for the response...I said I was a newby. ;) I had not yet discovered
the usercontrol. Seems a much better solution once I figure out the details.

Thanks again,
Sturdy
"cody" wrote:
There is no naming convention for such a very special case which should
indeed be avoided.
If there are identical things on different tabpages make them in one
usercontrol and put that in the different tabpages.
"Sturdy" <St****@discussions.microsoft.com> schrieb im Newsbeitrag
news:0F**********************************@microsof t.com...
Hi,
I'm new to C# and .NET. I'm a first time user of Visual C# 2005 Express
and
have a very basic question. I've looked at several links and lots of docs
but
can't find any tips on naming multiple controls used for the same purpose
on
different Forms.

Specifically, I have several identical TextBox controls each on a
different
TabPage. The textboxes display the same variable content on each TabPage.
An
example might be display of name and ssn on each page of a personnel form.
Is
there a naming convention for naming each TextBox control? I assumed the
container name could be used but I see that is a no-no. Of course,
txtName1,
txtName2 is possible but isn't very meaningful.

Also, I don't like to waste others time so if there is a more appropriate
forum/NG for us C# newbies, a link will be appreciated.

Thanks for the help and and Best Regards,
Sturdy


Apr 28 '06 #4
Thanks for the assist...
Here is a good link to some coding conventions:
http://weblogs.asp.net/scottdockendo...26/361020.aspx
I found and saved this link but didn't find anything to help with my
original question. Good info tho for us newbies.
What is the purpose of your form/tabpages/Application?
Basic data entry on multiple TabPages. I wanted data entered on the first
page to cascade to other pages. When I asked the question, I was concerned
about identical controls on more than one page. Clearly, I had not learned
enough to consider other means. Cody's response was helpful to get me
thinking again. But a UserControl is beyond me at this time. My final method
is to use a ComboBox bound to the DB on page one and a TextBox on other pages
with TextBox.Text = ComboBox.Text. Seems to work well and the default names
of the TextBoxes are usable since they are display only (never accessed).
I usually use the
name provided by visual studio for a control, i then remove the numbered
portion and replace it with some meaningul text that helps describe the
purpose of the control.
Won't this convention become confusing since IntelliSense will group by
object type?

If the controls are of such a nature that meaningful information can not be
attached to it you should generate the controls dynamically to safe yourself
some effort.

If you need some examples on how to create controls dynamivcally give me a
shout!

I was pleased to discover that Visual Studio 2005 professional has the
capability to check for naming conventions & other coding best practices.

http://msdn2.microsoft.com/en-us/lib...t8(VS.80).aspx
thanks

--
In Adversity lies opportunity! - Anonymous


I have lots of opportunity ;)
Thanks again,
Sturdy
Apr 28 '06 #5

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

Similar topics

77
by: Jon Skeet [C# MVP] | last post by:
Please excuse the cross-post - I'm pretty sure I've had interest in the article on all the groups this is posted to. I've finally managed to finish my article on multi-threading - at least for...
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:...
5
by: SuffrinMick | last post by:
Hello - I'm a newbie to coding! I'm working on an access 2000 database which has three tables: tblContacts - A list of customer contacts. tblOrgTypes - A list of organisational types....
4
by: Mark Broadbent | last post by:
stupid question time again to most of you experts but this is something that continually bothers me. I am trying to get into the habit of naming variables and controls in an assembly as per...
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: abprules | last post by:
Can somehow tell me the best way for multi user development to occur in MS Access? The situation is: We are creating a new database for a small company. There are 2 of us who want to...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.