Every once in a while a usercontrol will disappear from the form

  • Thread starter Thread starter Just Me
  • Start date Start date
J

Just Me

I have a usercontrol I created on a form.

Every once in a while it will disappear from the form but the statement
Friend WithEvents ControlText1...
is still there but the rest of the windows created statements relating to it
have disappeared!

Real pain as I then have to replace the control on the form and reset the
properties.

Is there any help for this?
 
Just Me said:
I have a usercontrol I created on a form.

Every once in a while it will disappear from the form but the statement
Friend WithEvents ControlText1...
is still there but the rest of the windows created statements relating to
it have disappeared!

Real pain as I then have to replace the control on the form and reset the
properties.

Is there any help for this?

I have had this same thing happen to me as well. I noticed that in one
instance it is happening because I was trying to set some data in
Control_Load that in design mode didn't exist. This caused the above
result. If I checked if I was in design mode or not I was able to stop this
behavior.
 
I just did that this morning because I got a message box in place of the
control I tried to place that said an object wasn't define in the paint
event for one of the controls on the control.

So I added:
if designmode then exit sub
in that routine and a couple of others that I thought might get called in
design mode.

I don't know if that's the end of these problems but it fixed it for now.

Thanks a lot
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top