473,464 Members | 1,605 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Buggy-Looking Behavior

I hate to jump to the conclusion that there is a bug going on here, so maybe
someone can help me.

I have added a new Class Library project to my solution, and to that I have
added a new User Control. I have placed a couple of things on its design
surface, and then, after adding references to this project into my main one,
dragged an instance of that control onto my main form in the form designer.

When I do that, one of several completely out-of-control things happens:
1) Sometimes, it won't give me an instance at all. Instead, I get a message
that says "Object reference is not set to an instance of an object."
2) Sometimes, it drags on ok, but the next time the form window refreshes,
all controls on the form have disappeared except for the custom one. Upon
inspecting the Windows Form Designer generated code, this is sometimes
because all the other controls have disappeared from the call to
Me.Controls.AddRange --- but sometimes they are still there; they just don't
show up until I remove the custom control from Me.Controls.AddRange.
3) Sometimes the entire form breaks and I get a white screen that says the
document cannot be designed or some other gobbledygook. Then I have to
manually remove the custom control from the guts of the Form Designer code
for it to work again.

This seems to happen to every custom control I design, and I can't figure
out why. It's rather hard on the ol' productivity.

May 22 '07 #1
1 1011
Peter wrote:
I have added a new Class Library project to my solution, and to that I
have added a new User Control. I have placed a couple of things on its
design surface, and then, after adding references to this project into
my main one, dragged an instance of that control onto my main form in
the form designer.
1) Sometimes, it won't give me an instance at all. Instead, I get a
message that says "Object reference is not set to an instance of an
object."
That sounds like you have code in the UserControl that is running at
/Design-Time/ and falling about in a heap. The DesignMode property on
the Control class allows you to detect this.
2) Sometimes, it drags on ok, but the next time the form window
refreshes, all controls on the form have disappeared except for the
custom one.
Quite likely, this is a by-product of the first problem. The Designer
(/really/) doesn't like having Exceptions thrown at it and is probably
getting quite upset by this.
This seems to happen to every custom control I design, and I can't
figure out why. It's rather hard on the ol' productivity.
Is there any reason you're adding a class library then putting a
UserControl /into/ it, rather than just creating a new UserControl
directly?

Regards,
Phill W.
May 29 '07 #2

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

Similar topics

4
by: David Levine | last post by:
Using v1.1. of the framework: I was writing a wrapper around the java.util.zip.ZipOutputStream class so that my app could access it using standard FileStream semantics and I ran into a...
17
by: rkusenet | last post by:
This sure looks like a troll, but IBM folks should go there and defend DB2 ...
11
by: Zoury | last post by:
Hi there! :O) I've noticed some strange behavior with the VS IDE. Here's two a can think of right now... but those are most fusstrating i've encountered. 1. Every now and then, I haven't...
0
by: Shaman | last post by:
hi, im working on this app that makes a treenode view out of data from an xml page, yet theres a few pieces of code that just will not get fixed by me. Anybody help me (code below 'Class...
4
by: Earl | last post by:
To upgrade or not? This, to me, is based upon whether or not Microsoft has -- at least -- fixed the buggy controls from VS2003: Combo (clearing and binding context issues) Checked ListBox...
9
by: Elliot Rodriguez | last post by:
WinXP Pro Let me preface this by saying I have developed with the .NET IDE since its release, and I consider myself reasonably savvy with it. I have a medium sized form with about 120 controls...
3
by: VK | last post by:
Internet Explorer 7 beta 2 preview CNET Editor review: <http://reviews.cnet.com/Internet_Explorer_7_for_XP_SP2_Beta_2/4505-3514_7-31454661-2.html?tag=nl.e415> Summary (my personal review...
3
by: kathleen | last post by:
Hi there, I'm new to this forum & to programming in general, and am really stuck with a piece of buggy code. Can anyone help? I have several problems which may or may not be related. I have...
9
by: Ryan | last post by:
Hi all, I'm playing with Lutz Roeders Reflector and have found several areas where I think there are issues in the framework libraries. I can't see how the following should work as expected and...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.