Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 2005 > BOOK: Beginning Visual C# 2005
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 17th, 2007, 08:15 PM
Registered User
 
Join Date: Feb 2007
Location: , , .
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?

Reply With Quote
  #2 (permalink)  
Old February 18th, 2007, 07:35 PM
Registered User
 
Join Date: Feb 2007
Location: , , .
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#.

Reply With Quote
  #3 (permalink)  
Old February 22nd, 2007, 06:16 AM
Registered User
 
Join Date: Feb 2007
Location: Thirsk, , United Kingdom.
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:01 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.