Skip to Content
avatar image
Former Member

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 04, 2008 at 10:22 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 08:03 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded