cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

HI,

U can link it to some item on the form.

Or in the form Resize event u can set its coordinates accordingly.

Vasu Natari.