Click here to Skip to main content
16,004,924 members
Home / Discussions / C#
   

C#

 
AnswerRe: A Question About Class Properties Pin
PIEBALDconsult4-Dec-09 17:44
mvePIEBALDconsult4-Dec-09 17:44 
GeneralRe: A Question About Class Properties Pin
Roger Wright4-Dec-09 18:02
professionalRoger Wright4-Dec-09 18:02 
GeneralRe: A Question About Class Properties Pin
DaveyM694-Dec-09 21:06
professionalDaveyM694-Dec-09 21:06 
GeneralRe: A Question About Class Properties Pin
Roger Wright5-Dec-09 2:59
professionalRoger Wright5-Dec-09 2:59 
GeneralRe: A Question About Class Properties Pin
PIEBALDconsult5-Dec-09 4:17
mvePIEBALDconsult5-Dec-09 4:17 
AnswerRe: A Question About Class Properties Pin
Richard Blythe4-Dec-09 18:08
Richard Blythe4-Dec-09 18:08 
GeneralRe: A Question About Class Properties Pin
Roger Wright4-Dec-09 18:24
professionalRoger Wright4-Dec-09 18:24 
GeneralRe: A Question About Class Properties Pin
Richard Blythe4-Dec-09 18:39
Richard Blythe4-Dec-09 18:39 
Ah, so old dogs can learn new tricks! Laugh | :laugh:

One fundamental rule to professional programming is separating your UI code from your business logic.

For example, if you was writing those child forms for me, I wouldn't want to access a field by the control. I would want to access a meaningful field name. For example:

EmployeeForm.EmployeeName

looks much better than:

EmployeeForm.NameTextBox.Text


This is where a good property would work great:

public string EmployeeName
{
get { return NameTextBox.Text; }
set
{
if (value == "")
throw new ArgumentException("Employee name cannot be empty!")
else
NameTextBox.Text = value;
}
}

I wish you the best. Just remember me when you become a millionare! Wink | ;)

If my answer has helped you, one of my articles may also be a help. Also remember that your best friend's name is google.

GeneralRe: A Question About Class Properties Pin
Roger Wright4-Dec-09 18:58
professionalRoger Wright4-Dec-09 18:58 
AnswerRe: A Question About Class Properties Pin
Luc Pattyn5-Dec-09 3:06
sitebuilderLuc Pattyn5-Dec-09 3:06 
QuestionReading x64 registry keys from a x86 computer remotely Pin
Jacob Dixon4-Dec-09 14:53
Jacob Dixon4-Dec-09 14:53 
AnswerRe: Reading x64 registry keys from a x86 computer remotely Pin
Dave Kreskowiak4-Dec-09 17:05
mveDave Kreskowiak4-Dec-09 17:05 
GeneralRe: Reading x64 registry keys from a x86 computer remotely Pin
Jacob Dixon4-Dec-09 18:13
Jacob Dixon4-Dec-09 18:13 
GeneralRe: Reading x64 registry keys from a x86 computer remotely Pin
Dave Kreskowiak5-Dec-09 3:41
mveDave Kreskowiak5-Dec-09 3:41 
GeneralRe: Reading x64 registry keys from a x86 computer remotely Pin
Jacob Dixon5-Dec-09 4:04
Jacob Dixon5-Dec-09 4:04 
QuestionActivating a child form Pin
electriac4-Dec-09 13:20
electriac4-Dec-09 13:20 
AnswerRe: Activating a child form Pin
Luc Pattyn4-Dec-09 13:27
sitebuilderLuc Pattyn4-Dec-09 13:27 
GeneralRe: Activating a child form Pin
electriac4-Dec-09 15:06
electriac4-Dec-09 15:06 
GeneralRe: Activating a child form Pin
Luc Pattyn4-Dec-09 15:45
sitebuilderLuc Pattyn4-Dec-09 15:45 
GeneralRe: Activating a child form Pin
electriac5-Dec-09 0:11
electriac5-Dec-09 0:11 
AnswerRe: Activating a child form Pin
Roger Wright4-Dec-09 17:29
professionalRoger Wright4-Dec-09 17:29 
AnswerRe: Activating a child form Pin
Shameel4-Dec-09 23:08
professionalShameel4-Dec-09 23:08 
GeneralRe: Activating a child form Pin
electriac5-Dec-09 0:07
electriac5-Dec-09 0:07 
GeneralRe: Activating a child form Pin
Shameel5-Dec-09 1:20
professionalShameel5-Dec-09 1:20 
GeneralRe: Activating a child form Pin
electriac5-Dec-09 2:17
electriac5-Dec-09 2:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.