p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 (http://p2p.wrox.com/forumdisplay.php?f=34)
-   -   Chapter 13 - Creating Your Own Custom Controls (http://p2p.wrox.com/showthread.php?t=713)

msjolin June 18th, 2003 03:48 PM

Chapter 13 - Creating Your Own Custom Controls
 
I cannot successfully add a custom user control to a form when following the instruction in chapter 13 (I get an error message) but I did find an alterative that works every time. Here's what to do:

First, create a "Windows Control Library" project and name it "MyControl"

Next, create a user control and add some objects - follow steps 1 thru 6, beginning on page 505 (or create your own sample if you want)

Next, "build" the control (this creates the DLL file that contains the control) then do a Save All. Close the project as we don't need it open any longer

Next, Create a new "Windows Application" project and call it “Controls”

Next, add a new toolbar tab and name it "User Controls"

Next, right-click on your new tab and select “customize toolbar”. Click on the ".NET components" tab then click on Browse. Traverse to the "Bin" folder containing hte DLL file that contains your user control. Click on "Open" and the DLL will be added to the list of .NET framework components. Your user control will be added to the User Controls tab

Next, double-click on the user control and it will be added to your form. You can now use your custom user control on any project! :)

Note that these steps are for visual studio version 2002. The steps are a bit different for verion 2003 (easier actually)

mark_sjolin@hotmail.com

Mark Sjolin

JonathanC June 19th, 2003 04:44 AM


Hi Mark

I am glad you found a way to move forward. :)




Jonathan Crossland
http://www.jonathancrossland.com

msjolin February 16th, 2004 09:01 PM

FYI in the latest version of .NET, the menu item name has been changed from "customize toolbar" to "Add/Remove Items...".

Mark Sjolin


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

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