Discussion Locked

VB6:Unable to unload within this context

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a form with a label set up as an array - Label1(0). I have used the Load and Unload events to put additional values into the array thus:-
for f=1 to 10
Load .Label1(f)
....
Unload .Label1(f)
next
My problem is this:
The firsttime through the code, the program has no problem Loading and Unloading, but subsequently I recieve the following error message:-Unable to unload within this context (Error 365)
I have looked at the MSDN help files but to no avail.
If anyone couldhelp I would be grateful

3 replies

by madestroitsolutions

Is your form set to autoredraw?

There are certain situations in which you cannot unload a control:

You cannot use unload on the "paint" event of the control.

If that doesnt help, I would need to look at the entire form code in order to tellhelp you out.

Good Luck!

by soundbomber

Thanks for the reply.
The autoredraw setting is false, but I tried it as True - didn't help.
I've gone as far as removing every other unload statement from the project - again didn't help.
Incidentally the full form code is HUGE and I probably wouldn't get permission from my bosses to send it to you.
Thanks anyway

This discussion is closed to new replies.