Skip to Content
avatar image
Former Member

UI SDK:Call Native VB form from SAP eventhandler

Hi all

I am trying to call a native Visual Basic form (ie a form that does not run within SAP Business one but as an ordinary windows window) from a menu added to SAP BO with UI SDK.

In my menu event handler for my SAP BO application I instantiate the form and show it:

Private Sub con_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.MenuEvent

Select Case pVal.MenuUID

Case "NewMenu"

If pVal.BeforeAction = True Then

myForm = New Form1()

myForm.show()

End If

End Select

End Sub

Only the window is created; the form is not populated, ie I have a "dead" window without the buttons etc that I've created on the form.

If I do

myForm = New Form1()

myForm.show()

in my main application (not in the eventhandler) it works fine.

Any good ideas?

Regards

Jesper Carstensen

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jun 10, 2004 at 12:18 PM

    Hi

    It is something to do with the .NET environment.

    In VB6 it works fine with the event handler.

    I think the problem is with subscribing twice to get system events (both forms in same process + SAP Business One Application object)

    two solutions:

    1. Change the oForm.Show() to oForm.ShowDialog().

    2. Open the form in a different process.

    Regards,

    Yaniv G.

    SDK Consultant,

    SAP Manage Israel.

    Add comment
    10|10000 characters needed characters exceeded