Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > BOOK: Beginning Visual C# 2005
|
BOOK: Beginning Visual C# 2005
This is the forum to discuss the Wrox book Beginning Visual C# 2005 by Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, Eric White; ISBN: 9780764578472
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 2005 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 February 17th, 2007, 08:15 PM
Registered User
 
Join Date: Feb 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 15 ToolStrip eclipses RichTextBox

In the Manual Menu example that spans several pages, a RichTextBox is present with dock property = fill. This is tested and working part way through the example. Then, on p. 459, a ToolStrip is added. After this, the RichTextBox doesn't seem to work.

I noticed that if I set the RichTextBox's dock property to bottom, it begins to work. The "fill" setting forces the first line or so of text up under the ToolStrip where it can't be seen so it appears that the RichTextBox never gets focus. Actually the line is just hidden and subsequent lines do display.

Setting dock to "bottom" exposes the entire RichTextBox but looks bad when the window is resized.

I noticed that at the bottom of form1.designer.cs, where the controls are added to the form, Visual C# 2005 seems to add the controls to the form with each new control added before the previous, i.e. if the RichTextBox is added in the forms designer before the ToolStrip then the code adds the ToolStrip to the form before the RichTextBox. If I reverse the order to add the RichTextBox first, then the project works as expected. The sample code adds the RichTextBox first so they must have built the form in this order, different from how the book specifies.

Has anybody noticed this? Is it a general rule that you must add to the forms designer in a certain order?

 
Old February 18th, 2007, 07:35 PM
Registered User
 
Join Date: Feb 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

After experimenting more with this I'm confident that it's true. Adding a ToolStrip or StatusStrip after the RichTextBox definitely eclipses part of the RichTextBox. This is directly affected by the order that the code adds the various controls to the form at the bottom of form1.designer.cs. You can tell in the designer because, when the RichTextBox is selected, you can see it's boundries either containing the other controls or not depending on the order they're added in the code.

I'd sure like to hear some comments about this from the authors or others. This could be a bug in Visual C#.

 
Old February 22nd, 2007, 06:16 AM
Registered User
 
Join Date: Feb 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to chiefengineer
Default

Hello,

I concur with you on this, as I've just seen the same thing. I've had to change the Dock property to "Bottom" to get around it. It even goes behind the Menu Bar, which was added before the Rich Text Box Control in the example.

Jeremy






Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter 15 help kyledonmoyer BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 June 30th, 2007 08:06 AM
chapter 15 manal_sag BOOK: Beginning ASP 3.0 2 March 13th, 2006 04:48 PM
chapter 15 manal_sag BOOK: Beginning ASP 3.0 1 June 18th, 2005 11:05 AM
chapter 15 manal_sag BOOK: Beginning ASP 3.0 0 April 22nd, 2005 02:23 PM
Chapter 15!! studentinpain BOOK: Beginning ASP 3.0 16 March 12th, 2004 10:26 AM





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