cancel
Showing results for 
Search instead for 
Did you mean: 

Auto resize tab controller when form resize?

Former Member
0 Kudos

Hi All,

I need to resize the tab controller (Folder) in user defined form, when the form resized. I tried 'Link To' property with no luck. Any suggestions are highly appreciated
.

Thank You.

J S L Geeganage

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hi All,

Finally, I could achieve what I wanted by handling the following event.


private void Form_ResizeAfter(SAPbouiCOM.SBOItemEventArg pVal)

{

     SAPbouiCOM.Form form = Application.SBO_Application.Forms.Item(formUID);

     //Item_0 is the ID of the Grouper

     var item = form.Items.Item("Item_0");

     item.Width = Relative Width;

     item.Height = Relative Height;

}

Now the borders of the tab will move with the screen.

Thanks All of your inputs and those were really helpful.

Best Regards,
J S L Geeganage

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi All,

My coding plus 50 in Matrix control.

  private void Form_ResizeAfter(SAPbouiCOM.SBOItemEventArg pVal)

        {

            //throw new System.NotImplementedException();

            ResizeMatrix();

        }

        void ResizeMatrix()

        {

            try

            {

                SAPbouiCOM.Item mt = (SAPbouiCOM.Item)this.UIAPIRawForm.Items.Item("Item_37"); // Matrix

                foreach (SAPbouiCOM.Item oitm in this.UIAPIRawForm.Items)

                {

                    if (oitm.Type == SAPbouiCOM.BoFormItemTypes.it_RECTANGLE)

                    {

                        oitm.Width = mt.Width + 50;

                    }                 

                }

            }

            catch

            {

            }

        }

former_member241304
Active Participant
0 Kudos

Hi Jeewan,

objForm = SAPbouiCOM.Application.Forms.Item(FormUID)

        oItem = objForm.Items.Add(ItemUID, SAPbouiCOM.BoFormItemTypes.it_FOLDER)

        oItem.Top = iTop

        oItem.Left = iLeft

        oItem.Width = iWidth

        Dim oFolder As SAPbouiCOM.Folder

        oFolder = oItem.Specific

        oFolder.Caption = Caption

        'oFolder.DataBind.SetBound(True, "", AliasName)

        oFolder.GroupWith(GroupItem)

Former Member
0 Kudos

Thanks for the reply Pallavi,

What kind of group item I should use? Is that ok to call that method without setting a data bind?

Regards,
J S L Geeganage

former_member241304
Active Participant
0 Kudos

Hi Jeewan,

objForm = SAPbouiCOM.Application.Forms.Item(FormUID)

        oItem = objForm.Items.Add(ItemUID, SAPbouiCOM.BoFormItemTypes.it_FOLDER)

        oItem.Top = "110"

        oItem.Left = "15"

        oItem.Width = "80"

        Dim oFolder As SAPbouiCOM.Folder

        oFolder = "Sample"

        oFolder.Caption ="Sample"

        'oFolder.DataBind.SetBound(True, "", AliasName)

        oFolder.GroupWith(UniqueId)

Former Member
0 Kudos

Hi Pallavi,

Thanks, but this 'UniqueId' is reffering to what? Is that a form, folder or?

Regards,
J S L Geeganage

former_member241304
Active Participant
0 Kudos

Hi Jeewan,

If you have any folder,it refer that uniqueid otherwise no need that line.

sory for the late reply.

Regards,

P.Pallavi

Former Member
0 Kudos

Hi Pallavi.

Thanks for the reply. But that didn't work for me. Folder margins still were in the same place.

Best Regards,

Former Member
0 Kudos

Hi Geeganage, the only way to do that is to catch the event of the form resize and manually change the folder border size.

Best Regards,

Silvio

Former Member
0 Kudos

Hi Silvio,

I had an exchange last week with Edy Simon, regarding resize while I was answering late after him to a similar post.

Regarding Rectangle, if you use them like... Rectangle it effectively won't resize. The workaround is to do just like what SAP does: uses it as a line (1 pixel width or height). To do a rectangle, you'll need four lines (objects) and they'll resize - move as expected.

Regards,

Eric

Former Member
0 Kudos

Thanks Eric and Silvio,

I could manage to resize the folders by changing the height and the width of the each folders. But the rectangle won't move and stay as it is. Could you please help me with that too.

I couldn't access the 'Grouper' by code as well, how exactly use four objects and will that clear the line which makes by the Folders.

Regards,
J S L Geeganage.