Click to See Complete Forum and Search --> : Hiding my Form in MyForm_Load() Event


bryker
August 20th, 2002, 05:46 PM
I have a form [a] which is being called modally (via ShowDialog) from another form [b].

In the Form_Load() event of this form [a], I am occasionally detecting a condition for which I want to hide the form. Unfortunately, calling .Hide does not seem to have any effect in the Form_Load() event.

Is there another (better) startup event for detecting these situations, where calling Me.Hide() will actually hide the form (and thus set execution back to the MyForm.ShowDialog() call in form [b] which caused form [a] to display?

By the way, Me.Hide() does work, since I use it in the btnCancel_Click() event of form [a]. It's just that it doesn't work in the Form_Load() event, apparently.

Thanks.

jayson_13
August 24th, 2002, 12:00 AM
put the me.hide() in form_activated() instead of form_load()
because the form not yet activated in form_load you cannot use hide()

rajtofar
August 24th, 2002, 12:30 AM
you know, if that doesn't seems to be an interesting sol. perhaps you can try a fancy way for the same.
You can set the transparancy of the form to 0 ...
do some R&D over it.. you might find something...
rajtofar