Passing Forms to other forms

I have a grid which the user can search on, they search via a find form. When they enter it calls the search back in the grid form. If I pass the grid form to the find form y

ByVal owningForm As frmcontacts

then I can activate the methods of frmcontacts.

frmcontacts.processsearch

The problem is I have numerous grids, so I need to make sure the find form can handle all forms implementing processsearch
rocky050371Asked:
Who is Participating?
 
Bob LearnedConnect With a Mentor Commented:
You define the interface without any scope modifiers:

Public Interface ISearchForm
   Sub ProcessSearch
End Interface

Then, it is up to the implementing class to define the scope:

Public Class frmSearch
    Implements ISearchForm

   Public Sub ProcessSearch() Implements ISearchForm.ProcessSearch
   End Sub

End Class

Bob
0
 
Bob LearnedCommented:
You can have the form implement an interface, and then try to cast the form as that interface, and get at the ProcessSearch method from the interface.

Bob
0
 
AutoeformsCommented:
instead of having a single find form why don't you created and instance of that form from the gird form.
when they hit your find button open it as a modal form  and then return to the same grid so everything is tied together.

good luck
greg
0
 
rocky050371Author Commented:
Can you create an interface which has public properties?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.