Wrox Programmer Forums
|
BOOK: Beginning Object-Oriented Programming with C#
This is the forum to discuss the Wrox book Beginning Object-Oriented Programming with C# by Jack Purdum; ISBN: 978-1-1183-3692-2
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Object-Oriented Programming with C# 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 January 11th, 2013, 06:01 PM
Registered User
 
Join Date: Jan 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Visual Studio 8 & BOOP w/C#

For anyone that comes looking for help with the exercises using Visual Studio 8:

In the example code shown in the book, pay attention to what specific objects are named when adding them to your window forms.

For example, the exercise for Ch. 2 has you adding labels, buttons and textboxes. Table 2-2 on pages 48-49 as well as the sample code you are to type on showing names like txtName.Text and txtZip.Text, txtDisplayOutput.Text.

To make this example work I had to change the names to textBox1.Text, textBox2.Text etc etc. Also you have to be sure and set the "Output" textbox = to the "buffer"

Here is what it looked like for me instead of what appears on page 49.

Code:
String buffer;

    buffer = "Mailing Label:" + Environment.NewLine +
        Environment.NewLine;
    buffer = buffer + "   Name: " + textBox1.Text +
        Environment.NewLine;
    buffer = buffer + "   Address: " + textBox2.Text +
        Environment.NewLine;
    buffer = buffer + "   City: " + textBox3.Text
        + "   State: " + textBox4.Text + "   ZIP: " + textBox5.Text;
    textBox6.Text = buffer;
This is because although you change the "Text" field in the properties pane it does not change the actual "(Name)" as far as the code is concerned. I was unable to actually change the "(Name)" field despite trying several ways. I've never programmed before so if this is incorrect then please straighten my path.


......
|\/\/|

Last edited by dcmininni; January 15th, 2013 at 01:50 PM.. Reason: Add info
 
Old January 14th, 2013, 02:20 PM
Friend of Wrox
 
Join Date: Sep 2008
Posts: 234
Thanks: 0
Thanked 32 Times in 30 Posts
Default Object names

Unless you change the object variable names yourself, they default to the object type (e.g., textbox) followed by a number. Since these are usually non-descriptive variable names, you will normally want to change them from their default (e.g., textbox1) to something that is more descriptive (e.g., txtName). You comment suggests that you didn't rename the objects to the more descriptive names I suggested early in the text.
__________________
Jack Purdum, Ph.D.
Author: Beginning C# 3.0: Introduction to Object Oriented Programming (and 14 other programming texts)
 
Old January 15th, 2013, 01:45 PM
Registered User
 
Join Date: Jan 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

For some reason or another I was not able to change object names through the properties pane. As of the Try It Out in Ch 4 I can now change the object names without manually going into the code. So whether my own fault or just a glitch, all is now well. Thanks.

Last edited by dcmininni; January 15th, 2013 at 01:57 PM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Studio 2008 & Voice Activation Detection Dave1980 Visual Studio 2008 0 April 2nd, 2012 04:24 AM
Help With Visual Studio 2008 & SQL Server 2005 Express Rambo Visual Studio 2008 3 December 21st, 2009 12:08 PM
Visual studio 2005(32 bit) code not work in visual studio 2008 on windows server 2008 gr8.jain Visual Basic 2008 Essentials 1 August 31st, 2009 10:07 AM
Report Designer & Visual Studio.NET JimReid Reporting Services 0 May 19th, 2006 07:48 AM
Visual Studio 2003 vs. Visual Studio 2005 eitanbarazani C# 2005 4 May 9th, 2006 01:34 AM





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