Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 151
  • Last Modified:

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
0
rocky050371
Asked:
rocky050371
  • 2
1 Solution
 
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
 
Bob LearnedCommented:
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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now