Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
745
buttontool not getting added to the UltraToolbarsManager
posted

Hi,

I have this following code;

    Public Sub SetIcons(icons() As icontypes)
        Dim stemp As String = "name"
        Dim i As Integer = 0
        Dim tools(icons.Length - 1) As UltraWinToolbars.ToolBase

        For Each Icon As icontypes In icons
            Dim buttontool As New Infragistics.Win.UltraWinToolbars.ButtonTool(stemp + i.ToString())
            tools(i) = buttontool
            i += 1
            Dim Appearance1 As Infragistics.Win.Appearance = New Infragistics.Win.Appearance()
            Appearance1.Image = ImageList1.Images(Icon.ToString())
            buttontool.SharedPropsInternal.AppearancesSmall.Appearance = Appearance1
            buttontool.SharedPropsInternal.Caption = "Temp" + i.ToString()

            Tbm1.Tools.Add(buttontool)

        Next

    End Sub

this code receives an array of enum type (enum named icontypes), each array element is operated upon. Each enum value is converted into string and looked at in the imagelist control for image present against its value, that image is assigned to a newly created button tool which then is added to the toolbar. After this code completes I expect to see a number of icons with images in the Tbm1, but I see nothing. Whats going wrong here.

Thanks.

Parents Reply Children
No Data