Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 22nd, 2012, 07:30 PM
Authorized User
Points: 130, Level: 2
Points: 130, Level: 2 Points: 130, Level: 2 Points: 130, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2012
Location: Australia
Posts: 32
Thanks: 1
Thanked 0 Times in 0 Posts
Unhappy Context Menu Not Working - Lesson 6 Ex 1

Hi all,

I am working through this book to teach myself C#. So far it is going well and apart from there being not enough explanation at times, i have been able to get everything to work.

However, now I am stuck.

I am working on the Simple Edit program and in lesson 6 ex 1 you have to add the tool strip container, toolstrips and the rich text box. After adding these items and setting their events etc, I ran the program and noticed that the context menu no longer works.

My first thought was that because i added the context menu before the container with the rich text box that the context menu order was behind them.

I deleted the context menu and re-added it after the container (with richtext box and toolstrips) but still when I run the program, the right click context menu doesnt work.

I am hoping i dont have to remake the program, although, better now than later.

Anyone know why the context menu would stop working after i add the container? Before adding, it was fine.
__________________
"These pretzels are making me thirsty"
  #2 (permalink)  
Old October 22nd, 2012, 10:03 PM
Authorized User
Points: 130, Level: 2
Points: 130, Level: 2 Points: 130, Level: 2 Points: 130, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2012
Location: Australia
Posts: 32
Thanks: 1
Thanked 0 Times in 0 Posts
Red face Solved

I couldnt help myself and continued to look through my program for the solution and found it.

In the Rich Text Box properties, I hadn't selected the context menu control in the ContextMenuStrip property.

Once selected, it works fine now.
__________________
"These pretzels are making me thirsty"
  #3 (permalink)  
Old October 23rd, 2012, 11:26 AM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Well done! It's always nice when someone answers their own question before anyone else gets to it

Related Tip: If you copy and paste a control like this from another Visual Studio session, be sure the controls to which it should be attached already exist where you paste it. That way it will often pick up the same connection. In this example, if you copy the ContextMenu first and then copy the RichTextBox, the RichTextBox may keep the connection to the ContextMenu. If you copy and paste the RichTextBox first, when you paste it the ContextMenu won't be there yet so the RichTextBox's ContextMenu property will reset to nothing.

Similarly if you copy and paste controls within the same project, you may sometimes face similar issues.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

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


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
CH 15 Context Menu - Element Menu Items Razzy The Pug BOOK: Ivor Horton's Beginning Visual C++ 2005 2 November 9th, 2008 03:53 PM
Need help in context menu Hannibal General .NET 0 January 3rd, 2007 12:24 AM
Context Menu ? zoltac007 BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 1 June 7th, 2006 05:44 PM
Context Menu JMorrell Beginning VB 6 2 February 18th, 2005 09:33 AM
context menu mookashi Pro VB 6 0 March 16th, 2004 06:48 AM



All times are GMT -4. The time now is 11:01 PM.


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