Wrox Programmer Forums
BOOK: Visual Basic 2005 Programmer's Reference
This is the forum to discuss the Wrox book Visual Basic 2005 Programmer's Reference by Rod Stephens; ISBN: 9780764571985
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2005 Programmer's Reference 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 October 13th, 2006, 07:50 AM
Registered User
Join Date: Oct 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Tabcontrols and Toolstrips

Could someone explain to me how to add a toolstrip to a form so each tabpage on a tabcontrol will react to it? I added a toolstrip to a form and then added a tabcontrol with 2 tabpages but once I click in a tabpage and then click a button on the toolstrip I get no response.
Any help would be greatly appreciated. I bought the book Visual Basic 2005 - Programmers Reference by Rod Stephens hoping to find an example that would show how to do this. This book is very informative but the tabcontrol example in Appendix G does not have a toolstrip.

Old October 14th, 2006, 12:51 PM
Rod Stephens's Avatar
Wrox Author
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts

This seems to work for me, although while trying things out I did make the button stop responding. The way it happened was I first built the form. Then I decided to add a ToolStripContainer so I added one, cut the ToolStrip off of the form, and pasted it into the ToolStripContainer.

Unfortunately when you cut and paste a control, Visual Studio removes the association between the control and any existing event handlers that it used to have. If you look way on the right (usually hidden because it's so far to the right) you will see that the Handles clause has been removed.

Check to see if this is what happened to you. If it did, you can add the Handles clause yourself. Or you can double-click on the new button to create a new event handler and copy-and-paste the old code into the new event handler.

Let me know if that was the issue.


Author of "Visual Basic 2005 Programmer's Reference"

Sign up for the free VB Helper Newsletters at http://www.vb-helper.com/newsletter.html

Similar Threads
Thread Thread Starter Forum Replies Last Post
TabControls dont want my buttons iceman90289 C# 2005 4 April 5th, 2008 05:48 AM

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