cancel
Showing results for 
Search instead for 
Did you mean: 

Child form?

AlexGrebennikov
Active Contributor
0 Kudos

Hi, friends!

I have 2 user forms, one form with report-parameters, the second one - for report-results.

Results-form must be modal (child) for Parameters-form (parent).

It meens that i shouldn't get access to first form when the second form is in focus..

What should i do to implement that?

Thanx!

View Entire Topic
Former Member

Hello Alexey, this is how I do it.

in my Add On, I have a class for each form, and I handle all event of this form in tis class.

in the parent form, I have a variable called FormUIDSon

When I open a son form, I set this variable with the UID of the son form

After, on the handle_Form_event methods of the father form, I added this code at the very beginning

Public Sub Handle_SBO_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles oApplication.ItemEvent
If Not IsNothing(mst_FormUIDSon) Then
  Dim oForm As Form
  For Each oForm In oApplication.Forms
    If oForm.UniqueID = mst_FormUIDSon Then
      oForm.Select()
      BubbleEvent = False
      Exit Sub
    End If
  Next
  'Form not found, so it means it has been closed                
  Me.mst_FormUIDSon = Nothing
 End If
  Select Case pVal.BeforeAction
    Case True
      Select Case pVal.EventType
            .....