Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the 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 October 11th, 2007, 10:05 AM
Authorized User
 
Join Date: Oct 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginning Visual c# 2005 - Chapter 15 help

I am currently working through 'Debugging User Controls' in Chapter 15 page 484. In Step 2 its says that in my toolbox I should see a new tab named LabelTextBox Components and in this tab I should see the control that I created called ctlLabelTextBox. I cannot find this tab in the toolbox nor can I find my control. I have followed these steps very carefully. Can anyone give me any guidance on this?

Lucy
 
Old October 11th, 2007, 10:30 AM
Authorized User
 
Join Date: Oct 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have tried looking at the downloaded code for this Chapter and when I try to open Form1.cs in the folder LabelTextBox. I get this error and the form cannot be opened:

Could not find type 'LabelTextbox.ctlLabelTextbox'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built.

The variable 'ctlLabelTextbox1' is either undeclared or was never assigned.

Lucy
 
Old October 11th, 2007, 10:40 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

I'm not familiar with the code in question, but have you tried compiling the solution before opening the Form. User control must be compiled before they can be viewed on forms (and changes only show up after a fresh recompile).


/- Sam Judson : Wrox Technical Editor -/
 
Old October 11th, 2007, 10:55 AM
Authorized User
 
Join Date: Oct 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK I have tried that now but still cant find my component. Can I get this component from the 'Choose Toolbox Items' dialog?

Lucy
 
Old October 12th, 2007, 03:21 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Are you loading the LabelTextBox.sln solution file.

You can't load the Form1.cs on its own as the solution must contain two projects, one called LabelTextBox and the other called LabelTextboxTest.

I downloaded the code and loaded the solution into Visual Studio 2005 and compiled it straight away. I then navigated to the Form1 form and it loaded just fine.

/- Sam Judson : Wrox Technical Editor -/
 
Old October 12th, 2007, 04:09 AM
Authorized User
 
Join Date: Oct 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have solved my problem. I deleted my form and then compiled my solution and then added a form as you suggested. In the toolbox I created a new tab and added a new component from 'Choose Item...' In this dialog i searched for my created component under the appropriate folder and navigated to bin\Debug. In this folder I opened LabelTextbox.dll. This successfully added my component to the toolbox.

I tried this method before I added a form but before I compiled my solution and this did not work. But after I tried what you suggested, compiling the solution and then adding a form, I was able to find and add the component to the toolbox.

Lucy
 
Old October 12th, 2007, 09:05 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Glad you got it working.


/- Sam Judson : Wrox Technical Editor -/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning Visual C++ 2005 pendragon Visual C++ 2005 1 June 3rd, 2007 04:27 PM
Beginning Visual C# or Beginning Visual C# 2005? FTemplar C# 2005 2 May 2nd, 2006 02:34 PM
Beginning asp 3.0: Chapter 15 karoshi BOOK: Beginning ASP 3.0 1 March 10th, 2005 05:58 PM
Beginning Visual C# Exercises - Chapter 15 seblake C# 1 September 17th, 2004 08:41 PM





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