cancel
Showing results for 
Search instead for 
Did you mean: 

Problem Positioning Check box on Folder

Former Member
0 Kudos

Hi All,

I am really pulling my hair out trying to position a text box on the screen.

I have added a new folder on the service call screen. This folder's pane level is set to 8. Now I want to add a check box onto that folder. I get the position of another item on the screen (let's say the Origin combo box on the first folder) and then I set my new item's top position to the same position as the Origin combo box. My code:

                        aItem = oForm.Items.Item("67") 'Origin Combo Box
                        oItem = oForm.Items.Add("chk_Refr", SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX)
                        oItem.Left = 10
                        oItem.Top = aItem.Top
                        oItem.FromPane = 8
                        oItem.ToPane = 8
                        oCheck = oItem.Specific
                        oCheck.Caption = "Refrigeration"

This code does not put it in the same top position as the Origin Combo box, but almost half way down the screen. I have tried various other top values. I have started at 10, which puts it right at the top of the screen, I go down to about 180 which puts it just above the row of folders.

BUT it seems like as soon as I move it onto the folder, at let's say Top = 200, it moves it down to 200 from the top of the folder! So it's way down. The difference from Top = 180 to Top = 200 is about 10cm (4 inches) on my screen?????

It does the same even if I remove the FromPane and ToPane property setting.

Any ideas?

Also, I have a matrix on another tab that I also added, which I set to the same top position and that works great, no problem. Seems like it's only with the check box?

Thanks for any help in advance,

Adele

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Adele,

The problem: the window has been resized, and you put your checkbox on et_form_load

Try the following:

Add you checkbox at et_form_load and pval.before_Action = false

at et_form_resize event and pval.Before_Action = false set the checkbox relative position to an existsing system created item.

This is always working, and you hair will be remain on your head:)

Regards

J

Former Member
0 Kudos

Thanks János and hahahah about the hair

I am going to try this, but why does it work with a grid then?

Former Member
0 Kudos

Thanks János! It worked. Added code to reset the position on the resize event and all is well

Answers (1)

Answers (1)

Former Member
0 Kudos

hello freind

have yu set top as like

oitem.top=aitem.top +180

try it

Former Member
0 Kudos

Hi, thanks for the reply.

Why would I want to do that? I want the item to move up a bit, not down even more.

The actual problem is that when I position it at 180 it is above the tab, when I position it at 200 it is way down on the screen, it's as if I can't get it into the space in between, which is about 10cm. I have tried oItem.Top = aItem.Top - 100, which just puts it right back to the top. Also tried oItem.Top = aItem.Top + 100, which puts it so low down it's almost off the screen.

I have tested with a check box and a text box, both have same behavior. Tested with a grid, doesn't do it.

Adele