There should be an award for most bizarre errors, for surely I would win. I spent a whole day pulling my hair out over this, but now I must seek help. Here we go...
I have a very simple program that has a form with something like the following:
Of course, upon executing anotherForm.Show, the anotherForm_Load method should run, and then the current form should disappear. This is exactly what happens when I run in debug mode or directly from the executable (on the development machine). I have confirmed it with both breakpoints and run-time messages.
However, on the test machine, run-time debugging messages indicate that, although anotherForm.Show is executed, the first line of anotherForm_Load never is! It just skips that part, goes right to Unload Me, closes the original form and, seemingly, the whole program. I say seemingly, because, some minimal bit of it stays alive and can be seen in the task manager. (When I first noticed that, I figured anotherForm was loaded but hidden, until I put in the run-time debugging messages and learned that it's Load method had never begun.)
It should be noted that I have 3 other nearly identical programs that perform this simple maneuver properly, in all cases.
Generally speaking, can anyone think of a situation in which newForm.Show would not cause the newForm_Load method to run, assuming that newForm is not already loaded?
I did read the excellent, recent post, "It's a Forms life...," by TheVampire. It taught me a lot but gave me no insight into what is happening here.
Now, as I sit and wait for help from you experts on this tough one, I'll see if I can answer some of the easier questions that are posted this morning. Thanks for any advice you can offer.
I have a very simple program that has a form with something like the following:
Code:
Private Sub someButton_Click
begin
anotherForm.Show 'anotherForm was not loaded previously
Unload Me 'there is no code in the Unload method
end
Of course, upon executing anotherForm.Show, the anotherForm_Load method should run, and then the current form should disappear. This is exactly what happens when I run in debug mode or directly from the executable (on the development machine). I have confirmed it with both breakpoints and run-time messages.
However, on the test machine, run-time debugging messages indicate that, although anotherForm.Show is executed, the first line of anotherForm_Load never is! It just skips that part, goes right to Unload Me, closes the original form and, seemingly, the whole program. I say seemingly, because, some minimal bit of it stays alive and can be seen in the task manager. (When I first noticed that, I figured anotherForm was loaded but hidden, until I put in the run-time debugging messages and learned that it's Load method had never begun.)
It should be noted that I have 3 other nearly identical programs that perform this simple maneuver properly, in all cases.
Generally speaking, can anyone think of a situation in which newForm.Show would not cause the newForm_Load method to run, assuming that newForm is not already loaded?
I did read the excellent, recent post, "It's a Forms life...," by TheVampire. It taught me a lot but gave me no insight into what is happening here.
Now, as I sit and wait for help from you experts on this tough one, I'll see if I can answer some of the easier questions that are posted this morning. Thanks for any advice you can offer.