Skip to Content
0
Former Member
Nov 30, 2005 at 05:25 PM

Adding an item but not finding it

33 Views

Hi

I can add an button to a form (the count property reflects that too) but i don't find it afterwards in the items - collection (you can reproduce the behaviour with the following code and by opening the businesspartners - form)

Tried with form.update,refresh but no success

TIA

Philipp


If pval.FormTypeEx="134" Then
	If  pval.BeforeAction=False And pval.EventType=SAPbouiCOM.BoEventTypes.et_FORM_LOAD Then
	' Button platzieren
	oForm=SBO_Application.Forms.Item(pval.FormUID)
	oItem = oForm.Items.Add("kit_1",SAPBouiCOM.BoFormItemTypes.it_BUTTON)
	oItem.Left=5
	oItem.Top=5
	oItem.Height=100
	oItem.Width=100
	oItem.Specific.Caption="Lala"
				
	For Each oItem In oForm.Items
	   If oItem.UniqueID="kit_1" Then
	    	SBO_Application.MessageBox("Halleluia")
	   End If
        Next