Wrox Programmer Forums
|
BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer
This is the forum to discuss the Wrox book Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer by Rod Stephens; ISBN: 9780470596906
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer 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 9th, 2011, 01:36 PM
Authorized User
 
Join Date: May 2011
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default contentsRichTextBox not recognized

I downloaded the code for Ex6-5 so I could work through the Tryit for Chapter 7. When I try and replace the MessageBox.Show("Undo"); line with contentsRichTextBox.Undo(); on Step by Step 2., I get an error that says the new entry does not exist. Any idea what might be going on? All I get from IntelliSense for content is ContentAlignment, and ContentsResized.
 
Old May 9th, 2011, 02:17 PM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Sorry about that. I think the control was named rchDocument in Exercise 6-5. We renamed a bunch of controls to give them a more consistent naming format and that one must have been missed.

The best solution is to use the Forms editor to rename the RichTextBox control from rchDocument to contentsRichTextBox. (Alternatively you could change the name in the code, but it would be better to rename the control.)

Let me know if you have more trouble with it.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
 
Old May 9th, 2011, 02:22 PM
Authorized User
 
Join Date: May 2011
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Rod, so would the syntax you are suggesting be contentsrchDocument.Undo();?
 
Old May 9th, 2011, 02:54 PM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Hi Mark,

If the control is named rchDocument (which I think it is), then the syntax would be:
rchDocument.Undo();
If you change the control's name to contentsRichTextBox, then the code would be:
contentsRichTextBox.Undo();
Basically it's whatever the control's name is followed by ".Undo();"

When you start typing "contents," IntelliSense should list the control.

If you can't remember the control's name (for example, in a larger program that you haven't looked at for a while), try typing "RichTextBox" and see if IntelliSense can list it for you.

Keep me posted.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
 
Old May 9th, 2011, 03:01 PM
Authorized User
 
Join Date: May 2011
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Rod, just changing the line to match rchDocument worked, thanks for you help, and congrats. on writing a very useful book also.
 
Old May 9th, 2011, 03:02 PM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Glad I could help. Sorry to have confused the issue to begin with.

Let me know if you have other problems with the book.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)





Similar Threads
Thread Thread Starter Forum Replies Last Post
ruby is not recognized.... Crippy RoR Ruby on Rails 1 July 16th, 2008 08:37 AM
Database changes not recognized until restart semilemon C# 5 April 26th, 2006 06:19 PM
not recognized nachtegaal9999 ASP.NET 1.0 and 1.1 Basics 0 April 25th, 2006 02:04 PM
'net' is not recognized as a command ababb BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 7 December 20th, 2004 02:31 PM
ch15: can't get JSTL to be recognized brownale2k JSP Basics 1 August 8th, 2003 04:32 PM





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