Wrox Programmer Forums
|
BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3
This is the forum to discuss the Wrox book Beginning C# 3.0 : An Introduction to Object Oriented Programming by Jack Purdum; ISBN: 9780470261293
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 22nd, 2010, 12:40 AM
Registered User
 
Join Date: May 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Objects

Hello,

I am having a hard time adding objects to the frmMain project (page 41). How do I name all the different objects (label1, label2, etc) and set their property values?
I set the project properties in the source window but my screen does not look exactly like Figure 2-11 page 39.
My first line says: Solution Mailinglabel (1project)
2nd line: MailingLabel
3rd: References. When expanded: Accessibility, System, System.Drawing, System.Windows.Forms
4th: frmMain.cs When expanded: frmMain.resx.
I was wondering if you or anybody else have written a book for total beginners so we can understand the concept first without getting overwhelmed with code.

Thank you
 
Old May 22nd, 2010, 07:13 AM
Friend of Wrox
 
Join Date: Sep 2008
Posts: 234
Thanks: 0
Thanked 32 Times in 30 Posts
Default Adding objects

You need to back up a little. Indeed, it appears you may have "glossed over" Chapter 1. On page 12, the book tells you how to move an object from the Toolbox to a form. Page 13 tells you how to change an object's property (the Text property is used in the example). Re-read pages pages 11-16 and you should see how to change the properties of an object. Chapter 2 goes into more detail, but you need to understand the basics in Chapter 1 first. As mentioned in the book, you can always call up the Properties Window by pressing F4.

It is VERY important that you understand the approach I use for starting a new project, because it is a little different than the way most books teach you how to do it. Every program in the book starts with the same frmMain shell, as shown in Listing 2-1 (pp. 38-39). In fact, I have this little chunk of code stored in my Programming directory as frmMain.cs. I always start a project by adding that file to the project using the details presented in the book (pp. 38-40). Pages 40-46 also present more details on how to set an object's properties.

Please go back and re-read Chapter 1 and then slowly read Chapter 2. I think you'll find all the answers to your questions. Thousands of novice programmers have learned how to program, and so can you. Take your time, think about the design of your programs (using the Five Program Steps) no matter how simple they seem before you start coding, and then start to write your program and you'll do just fine.
__________________
Jack Purdum, Ph.D.
Author: Beginning C# 3.0: Introduction to Object Oriented Programming (and 14 other programming texts)
 
Old May 22nd, 2010, 06:46 PM
Registered User
 
Join Date: May 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Objects

Hello,
That was helpful, I got to set the objects and their properties the only thing is that the objects do not line up the way it is shown on page 43 (figure 2-13).
How would C# know where to place them if it does not have any coordinates?
There is a property called location. Don't we need to set this property?
Another way to place them in position would be to use the mouse but I do not know how accurate this method is. My question I guess is how did the objects get lined up so nicely without some kind of coordinates?
Another problem I encountered was with the added code. First all the: [+txtName, txtAddress], etc would not pass the compiler once they were changed to [textName] etc they passed also the last line [txtDisplayOutput.Text = buffer;] page 44 gives me an error: The name [txtDisplayOutput.Text = buffer;] does not exist in the current context.
Any suggestions will be greatly appreciated.

Thank you
 
Old May 22nd, 2010, 08:24 PM
Registered User
 
Join Date: May 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Last line

Last line problem on page 44 was solved.
Object name in table 2-2 page 42 is [txtResult]. When [txtDisplayOutput.Text] is replaced by [textResult.Text] it works fine.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Value objects rayback_2 BOOK: Beginning Cryptography with Java 1 May 13th, 2008 05:04 PM
PHP Objects virka Beginning PHP 1 February 9th, 2007 04:21 PM
Cannot use class objects wcambris Access VBA 2 January 22nd, 2006 06:39 AM
Com Objects henryh MySQL 0 July 2nd, 2003 03:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.