Skip to Content
author's profile photo
Former Member

UI: Click event to button?

I have a form with a button on it - When the button is clicked, I want some code to run... How can I do this?

I've got this code so far (extract):

Dim oItem As SAPbouiCOM.Item

Dim oButton As SAPbouiCOM.Button

oItem = frmVareAddOn.Items.Add("Seek", SAPbouiCOM.BoFormItemTypes.it_BUTTON)

With oItem

.Height = 19

.Left = 365

.Top = 28

.Width = 65

End With

oButton = oItem.Specific

oButton.Caption = "Seek..."

How can I tell the application that a messagebox should be displayed, when the button is clicked?

Hope someone can help!

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Apr 21, 2004 at 01:24 PM

    Thanks.

    It won't work... Can you possibly give me an simple code example of how this works?

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Rune,

      sorry, but at my PC it worked immediately!?!

      So what exactly does not work?

      Regards,

      Frank

      PS: IMHO the sample is really simple as there's nothing in it except startup code (attaching to SBO, windows message handling, main procedure) + a list of events handled in the "item event handler".

      So how would you like the sample to be instead?

      Please note that there's less ItemEvent handler code in the UI API helpfile.

  • Posted on Apr 21, 2004 at 12:58 PM

    Hi Rune,

    Thanks for your post.

    Please

    - check the "Catching events" sample in the developer area for SAP Business One or

    - see the help file for SAP Business One UI API ("Programming with the UI API" / "Event Handling" / ...) or

    - see the help file for SAP Business One UI API ("UI API Reference" / "Overview" / "Events" / "Item Events") or

    - perhaps get trained in a TB1300 course (for the SBO-SDK)!

    Regards,

    Frank

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Apr 21, 2004 at 01:03 PM

    You'll have to write some code to process the "events" that the UI SDK sends.

    Take a look at the "Catching Events" sample under Downloads on the Business One part of the SDN site.

    Add comment
    10|10000 characters needed characters exceeded