cancel
Showing results for 
Search instead for 
Did you mean: 

UI: Click event to button?

Former Member
0 Kudos

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!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Thanks.

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

former_member185703
Active Contributor
0 Kudos

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.

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

former_member185703
Active Contributor
0 Kudos

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