Which form?

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I am using a variable f (of type form) which would either refer to form1 or
form2 depending on which form is on top. How can I now using f as handle
call a procedure which exists in both form1 & form2? The reason for using f
is so procedure is automatically called for the form which is on top.

Thanks

Regards
 
* "John said:
I am using a variable f (of type form) which would either refer to form1 or
form2 depending on which form is on top. How can I now using f as handle
call a procedure which exists in both form1 & form2? The reason for using f
is so procedure is automatically called for the form which is on top.

\\\
If TypeOf f Is Form1 Then
DirectCast(f, Form1).DoSomething()
ElseIf ... Then
...
End If
///
 
I am using a variable f (of type form) which would either refer to
form1 or form2 depending on which form is on top. How can I now
using f as handle call a procedure which exists in both form1 &
form2? The reason for using f is so procedure is automatically called
for the form which is on top.

If both have the same method, then, IMO, creating a form with the method and then inherit the other forms from it is the best method.
 
-----Original Message-----
Hi

I am using a variable f (of type form) which would either refer to form1 or
form2 depending on which form is on top. How can I now using f as handle
call a procedure which exists in both form1 & form2? The reason for using f
is so procedure is automatically called for the form which is on top.

Thanks

Regards


.


set the topmost property of the form to true.
 
Back
Top