Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to set size of rectangle dynamically depending on form size ?

Hi,

why does the size of a rectangle is not depend on the fom size? Can i set the size of my rectangle dynamically, depending on the user form size?

best regards

Markus

Former Member replied

Markus,

I use the following in the FormResize event:


    Private Function ItemHandler_FormResize(ByRef oCompany As SAPbobsCOM.Company, _
            ByRef oApplication As SAPbouiCOM.Application, ByRef pVal As SAPbouiCOM.ItemEvent) As Boolean
        ItemHandler_FormResize = False

        oForm = oApplication.Forms.GetForm(pVal.FormTypeEx, pVal.FormTypeCount)

        Try
            oForm.Freeze(True)

            If pVal.BeforeAction = False Then
                oForm.Items.Item("FldRtg").Width = oForm.Width - 20
            End If

            ItemHandler_FormResize = True
        Catch ex As Exception
            oApplication.MessageBox("ItemHandler_FormResize(): " & ex.Message.ToString)
        Finally
            oForm.Freeze(False)
        End Try
    End Function

Regards,

VĂ­tor Vieira

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question