Welcome Notes

Welcome Viewers

06 March 2018

Add button through SDK

Dear All,
   Today , We will see, How to Add button through SDK



Friend Sub AddButton(ByVal objForm As SAPbouiCOM.Form, ByVal SourceID As String, ByVal ItemUID As String, ByVal iLeft As Integer, ByVal iWidth As Integer, ByVal LinkTo As String, ByVal Caption As String, ByVal iHeight As Integer)
        Try
            Dim oItem As SAPbouiCOM.Item
            If objForm IsNot Nothing Then
                oItem = objForm.Items.Add(ItemUID, SAPbouiCOM.BoFormItemTypes.it_BUTTON)
                oItem.Top = objForm.Items.Item(SourceID).Top
                oItem.Left = iLeft + (objForm.Items.Item(SourceID).Left + objForm.Items.Item(SourceID).Width)
                oItem.Width = iWidth
                oItem.Height = iHeight
                oItem.LinkTo = LinkTo
                Dim btn As SAPbouiCOM.Button = objForm.Items.Item(ItemUID).Specific '' To Assign New Button
                btn.Caption = Caption
            End If
        Catch ex As Exception

        Finally
          
        End Try
    End Sub

Cursor focus on Grid Row

Dear All,
   Today , We will see, How to set Cursor focus on Grid Row through SDK.



C#.Net
_Grid.Columns.Item("Colunique").Click(0, false, 0);

VB.net
_Grid.Columns.Item("Colunique").Click(0, false, 0)

Get Matrix Combo Box Selected Value through SDK

Dear All,
   Today , We will see, How to Get Matrix Combo Box Selected Value through SDK.


Public Function GetComboBoxSelectedValue(ByVal oMatrix As SAPbouiCOM.Matrix, ByVal intRowIndex As Integer, ByVal intColIndex As Integer) As Integer
        Dim oComBo As SAPbouiCOM.ComboBox = oMatrix.Columns.Item(intColIndex).Cells.Item(intRowIndex).Specific
        Return oComBo.Value.Trim()
    End Function