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
  • 71886
    Offline posted

    Hello,

    Do you have the 'DisplayStyle' on the 'SharedPropsInternal' object of the tool set to 'ImageAndText'? If this is true and you still unable to see the image, please check if the tool is being added to any toolbar. If you are adding it only in the 'Tools' collection of the toolbarsmanager, it will not show anywhere.

    Do you want me to create a sample for you or to review some sample of your and modify it?

    Please let me know, I will be waiting for your feedback.

Reply Children