Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2010 > BOOK: Visual Basic 2010 Programmer's Reference
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Visual Basic 2010 Programmer's Reference
This is the forum to discuss the Wrox book Visual Basic 2010 Programmer's Reference by Rod Stephens; ISBN: 9780470499832
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2010 Programmer's Reference 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 January 23rd, 2012, 10:42 PM
Registered User
Points: 29, Level: 1
Points: 29, Level: 1 Points: 29, Level: 1 Points: 29, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Location: Wisconsin USA
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default User Control Constant Error Correction

Anyone:

I have a project that I am designing a User Control to use within. I started a Windows Forms Project, then I am laying out the User Control in-project. I don't want to compile the user control as a DLL, I want to keep it as a part of my final form project.

The problem I have is: Every time I run the project, an Exception Error pops up which says "Type 'ApplicationName.ControlOnFormName' is not defined. If I select the top suggestion... It changes the Form Designer code as follows:


Me.ControlOnFormName = New ProjectName.UserControlName()

Me.ControlOnFormName = New Global.ProjectName.UserControlName()


Now... The application will run fine, over and over, until I close the Form Designer. The Form Designer, upon closing, sets the code back to the top line. (No Global)

(Which is the never-ending loop: I correct - It runs fine - I close the Designer - It errors...) Now... The .exe file always runs if I build after the correction... : : stumped : :

Why does this happen??? And... is there a better way to keep a User Control within the project without having to reference a dll????

Ken C
Madison WI
Reply With Quote
  #2 (permalink)  
Old January 24th, 2012, 10:31 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

Pretty weird. What is the name of the control class? All I can think of right now is that it might be a reserved word. It adds Global to differentiate it from something else but then the designer isn't smart enough to preserve that change (which seems likely because it's an error correction change).

If that's what's happening, you should be able to get around it by changing the name of the class.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
Reply With Quote
  #3 (permalink)  
Old January 24th, 2012, 09:31 PM
Registered User
Points: 29, Level: 1
Points: 29, Level: 1 Points: 29, Level: 1 Points: 29, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Location: Wisconsin USA
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Rod:

I appreciate your reply... I am at odds with this problem, as it is the third project that this error has occurred where I attempt to include a User Control. It has to be something I do as a habit that is 'BAD'.

(Background: I am just now switching from Classic VB to .NET... I am 49 years young - and hate the fact that yet another thing in my life is being called 'Classic'. Feeling old...)

I realize you are busy... I stripped down the project to a bare minimum and removed the unnecessary files. It is the start of s simple label printing project I am using to learn the ways of .NET....

I uploaded it temporarily to this location.

http://www.aloftware.com/UserCtlError.zip

I would really like an answer to this... It is driving me nuts!

Thanks in advance, if you can look in to it,

Ken
Reply With Quote
  #4 (permalink)  
Old January 24th, 2012, 10:08 PM
Registered User
Points: 29, Level: 1
Points: 29, Level: 1 Points: 29, Level: 1 Points: 29, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Location: Wisconsin USA
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

note.... If you ignore the error upon opening the form (Click to ignore), you can then then see the issue by: switching to the form design from anything else... The designer code automatically corrects, which makes the project not run until you use the suggested 'fix' to add the GLOBAL piece to the control 'Load NEW' line........ (If that makes any sense!!)
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
Error in User Control Edward Colins BOOK: Beginning ASP.NET 4 : in C# and VB 9 September 26th, 2010 08:40 AM
Error adding Report Viewer Control in Web User Con everest ASP.NET 2.0 Professional 0 January 29th, 2008 07:24 PM
Add Windows User control in Web User Control agarwalvidhu C# 0 March 30th, 2006 01:17 AM
User Control Syntax error g2000 BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 1 December 22nd, 2005 06:04 PM



All times are GMT -4. The time now is 08:30 PM.


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