473,387 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Debugging a problem adding a Usercontrol to a form

I have a large Usercontrol that I just converted from VB6 (so I'm not
surprised there are bugs in it.)

When I try to add an instance to a form I get an exception occurred trying
to create and instance, "Specified cast not valid"
If it happened at runtime I would breakpoint and single step to find the
statement causing the problem.

What can I do at design time to localize the bug?

Thanks
Nov 21 '05 #1
2 1207
Hi Just me,

Do you have option Strict On in all your forms?

Cor
I have a large Usercontrol that I just converted from VB6 (so I'm not
surprised there are bugs in it.)

When I try to add an instance to a form I get an exception occurred trying
to create and instance, "Specified cast not valid"
If it happened at runtime I would breakpoint and single step to find the
statement causing the problem.

What can I do at design time to localize the bug?

Thanks

Nov 21 '05 #2
Did you see that there is a chat about debugging today/tomorrow depending on
your timezone

Message from Jason Cooke.

[ANN] August 17, "Debugging Visual Basic .NET Applications" chat

Join members of the Visual Basic .NET and Debugging teams to discuss
debugging Visual Basic .NET applications with the Visual Studio .NET
Debugger. Almost every program will need to be debugged sometime, so take
this opportunity to learn more about debugging from the experts.

Date:
August 17, 2004
1:00 - 2:00 P.M. Pacific time
4:00 - 5:00 P.M. Eastern time
20:00 - 21:00 GMT
(For a list of local time zones relative to GMT, please see
http://msdn.microsoft.com/chats/timezones.asp.)

Outlook Reminder:
http://msdn.microsoft.com/chats/outl...ET_Aug1704.ics

Location:
http://msdn.microsoft.com/chats (then click the name of the chat to enter
the chat room)

For more information about Visual Basic .NET, see
http://msdn.microsoft.com/vbasic/
To see a list of upcoming chats or set a reminder for this chat, see
http://msdn.microsoft.com/chats.
For archives of previous chats, see
http://msdn.microsoft.com/chats/recent.asp.

Thanks!
Jason Cooke
VB.NET Team

========
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
(c) 2004 Microsoft Corporation. All rights reserved.

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Marina | last post by:
Hi, Consider the following situation I have the following routine running repeatedly (curControl is a UserControl with say 1000 textboxes and a big array of strings): Public Sub...
6
by: Robin Bonin | last post by:
In my user contol I am creating a set of dropdownlists. Each list is created based on input from the other lists. The problem I am having is setting the selected index on the lists. If someone...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
6
by: ?scar Martins | last post by:
Hi When I'm debugging and somewhere in the code I have a breakpoint, many times when the code after breakpoint finishes and the app returns I can do nothing within in it(it's like freeze)... The...
2
by: Shallotx | last post by:
I am building a simple user control - a listview, a couple buttons. I build the solution, drop the control on a form, and all is well. I then go back, modify the Usercontrol, rebuild, and still...
1
by: bonk | last post by:
I have a very simple UserControl (derived from System.Windows.Forms.UserControl) that contains several ListViews. The UserControl exposes a single public property: public...
3
by: Steve Long | last post by:
Hello, A UserControl that I'm developing is causing an InvalidCastException to be thrown when the form, with the userControl on it, is shown. The trouble is that I don't seem to be able to debug...
3
by: Greg | last post by:
This works properly: 1. Create a new Form and set it's size to 229, 474. 2. Drag a Panel to the form and set the following properties: Size = 216, 438 Location = 3,1 Anchor = Top, Bottom...
10
by: Doug Robertson | last post by:
First off, I'm a hardware/OS guy. I just write code on the side and I'm completely self taught - so bear in mind my total lack of expertise. I have a program originally written in VB2003 using...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.