Jump to content
Xtreme .Net Talk

Recommended Posts

  • Leaders
Posted

This is happening in the designer when you drag it out from the toolbox?

 

It sounds like an error is occuring inside the control. Is it .Net? VB6 ActiveX? If it is something of your creation, you might want the control's source code for errors or debug it. If not, you might want to check and ensure compatability.

[sIGPIC]e[/sIGPIC]
Posted

Yes marble_eater, this is happening when I drag it out from the toolbox :(

My project is a 'simple' windows application (in vb.net) with some forms and user controls.

What I don't understand is why do I get an error with just one of the user controls. The others are ok.

All of them have the same properties, what changes is the controls in them..

  • Administrators
Posted

Is the control one written in house or developed by a third party? Also is the control a .Net control or an ActiveX control you are using under .Net?

 

If it is a 3rd party control try re-installing it and see if that fixes the problem - if an inhouse control check there haven't been any breaking changes made to it recently.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
I think you can put MessageBox.Show into the constructor code of your control and they will be displayed when you create an instance in the designer. This will tell you where you are in your code and should help you narrow down where the error is coming from.
  • Leaders
Posted
Repent from your old VB6 ways! Use Debug.WriteLine instead. :)

Besides the fact message boxes aren't really the VB6 way (we did have Debug.Print in VB6, no?), MessageBox can be better; it pauses execution and you are certain to see the information, and you can break execution if the data doesn't seem right. Of course, it also requires removal or conditional compilation, and most of what you can do with a messagebox can also be done with breakpoints. Ultimately a matter of preference, I suppose.

[sIGPIC]e[/sIGPIC]
Posted
Looks like you have something in the control that isn't being created. What the code in the control's constructor or Load event look like?

:confused:

I have nothing in load event.. I've created a LoadValues procedure to prevent that from happening.

That procedure is called only when the form (wich contain the control) displays.

 

 

 

I think you can put MessageBox.Show into the constructor code of your control and they will be displayed when you create an instance in the designer. This will tell you where you are in your code and should help you narrow down where the error is coming from.[/Quote]

I put messageboxes in new and initialize procedures, and I still couldn't see where the error is, because it is the first message I see.. No description, nothing..

Posted
Besides the fact message boxes aren't really the VB6 way (we did have Debug.Print in VB6' date=' no?), MessageBox can be better; it pauses execution and you are certain to see the information, and you can break execution if the data doesn't seem right. Of course, it also requires removal or conditional compilation, and most of what you can do with a messagebox can also be done with breakpoints. Ultimately a matter of preference, I suppose.[/quote']

 

That makes sense. The point being: know what tools you have available. (Thou a break point is always > a message box IMO)

 

I made the VB6 comment because few are the MFC prorammers who debug using AfxMessageBox. :)

"Who is John Galt?"
  • Leaders
Posted
The fact of the matter is that we really don't know what is going on inside of your control and it is hard to give advice. The best one can do is tell you that you are trying to use an object you haven't created. The control probably tries to access something that isn't created until LoadValues is called. Check you're Resize event handlers, Invalidate event handlers, etc. to see if they access an object that wouldn't be initialized at design time (since the LoadValues function probably won't get called at design time). Check any initialization code that will be called at design time. Throw in some message boxes, or debug output or something.
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...