Skip to Content
Jul 07, 2015 at 03:11 PM

A function to set the size and position of an object.


Hi, everybody

We write our add-ons using VB.NET in Visual Studio.

Everything is coded in VB.NET / SDK, and we don't use B1DE (yet). We must find time to learn that tool someday!.😉

The sizes and positions of all objects are coded like:

oItem = oForm.Items.Add("EditTxt", SAPbouiCOM.BoFormItemTypes.it_EDIT)

oItem.Left = 820

oItem.Width = 125

oItem.Top = 750

oItem.Height = 10

oEdit1 = oItem.Specific

As we use a large number of these codes, I am wondering if we can use a function (or should we use a sub?) to code the dimensions.

For ex. we could have a function called LeftWidthTopHeight(), so that the lines in bold above could be replaced by a single line:


Sometimes we develop very lengthy add-ons; so this could reduce coding.

Any ideas on how to achieve this are most welcome.