/// <summary> /// Adiciona um novo item ao formulário /// </summary> /// <param name="ItemUID">ID do Item</param> /// <param name="pItemType">Tipo do Item</param> /// <returns>Um novo item</returns> public SAPbouiCOM.Item AddItem(string ItemUID, SAPbouiCOM.BoFormItemTypes pItemType) { return(FormBind.Items.Add(ItemUID, pItemType)); }
private SAPbouiCOM.Item addPaneItem(SAPbouiCOM.Form form, string id, int l, int t, int w, int h, string label, SAPbouiCOM.BoFormItemTypes type, int pane, int order, int lbw = 0) { SAPbouiCOM.Item oItem = null; try { if (lbw == 0) { lbw = w; } int toPane = pane + 1; int fromPane = pane; if (label == CC_CARDNUM || label == CC_CARDCODE || label == CC_EXPDATE || label == CC_CARDNAME) { toPane = pane; fromPane = pane; } else if (label == EC_ROUTING || label == EC_ACCOUNT) { toPane = pane + 1; fromPane = pane + 1; } oItem = form.Items.Add(id, type); oItem.AffectsFormMode = false; SAPbouiCOM.Item oItm = form.Items.Item(id); oItm.FromPane = fromPane; oItem.ToPane = toPane; oItm.Left = l; oItm.Top = t; oItm.Width = w; oItm.Height = h; if (type == SAPbouiCOM.BoFormItemTypes.it_BUTTON) { SAPbouiCOM.Button btn = (SAPbouiCOM.Button)form.Items.Item(id).Specific; btn.Caption = label; } else { if (label != "") { string lb = "LB" + order.ToString(); oItm = form.Items.Add(lb, SAPbouiCOM.BoFormItemTypes.it_STATIC); oItm.ToPane = toPane; oItm.FromPane = fromPane; oItm.Left = l - lbw; oItm.Top = t; oItm.Width = lbw; oItm.Height = h; setLabelCaption(form, lb, label); } } if (type == SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX) { SAPbouiCOM.ComboBox oComboBox = (SAPbouiCOM.ComboBox)form.Items.Item(id).Specific; oComboBox.ExpandType = SAPbouiCOM.BoExpandType.et_DescriptionOnly; } } catch (Exception ex) { errorLog(ex); } return(oItem); }