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
1176
adding images to explorer bar items
posted

hi to all

im trying to add images to my explorer bar items but im not able and dont know why

this is my code

 Private Sub LoadExplorerBarData()
        Dim DTTask, DTSubTask As New DataTable
        Dim x, s As Integer

        ExplorerBar.ImageListLarge = ImageList1
        ExplorerBar.ImageListSmall = ImageList1
        DTTask = CostPlanning.Conn.GetData("SELECT DISTINCT TASK_NAME FROM TBL_TRAFIC_CONTROL ")

        If DTTask.Rows.Count > 0 Then

            For x = 0 To DTTask.Rows.Count - 1
                'tscbDepartment.Items.Add(DT.Rows(x).Item(0))

                ExplorerBar.Groups.Add(DTTask.Rows(x).Item(0), DTTask.Rows(x).Item(0))
                '----------------------------------------------------------------------------- Fill subtask
                DTSubTask = CostPlanning.Conn.GetData("SELECT  SubTask FROM TBL_TRAFIC_CONTROL WHERE TASK_NAME = '" + DTTask.Rows(x).Item(0) + "'")

                If DTSubTask.Rows.Count > 0 Then
                    For s = 0 To DTSubTask.Rows.Count - 1
                        ExplorerBar.Groups(x).Items.Add(DTSubTask.Rows(s).Item(0), DTSubTask.Rows(s).Item(0))
                        With ExplorerBar.Groups(x).Items(s).Settings.AppearancesLarge.ActiveAppearance
                            .ImageHAlign = Infragistics.Win.HAlign.Left
                            .ImageVAlign = Infragistics.Win.VAlign.Middle
                            .Image = ImageList1.Images("Task")
                        End With

                    Next
                End If
                '------------------------------------------------------------------------------
            Next

        End If

    End Sub

any idea?, Thanks.

  • 69832
    Verified Answer
    Offline posted

    Instead of assigning the image to the items's Settings.AppearancesLarge.ActiveAppearance.Image property, assign it to the Settings.AppearancesLarge.Appearance.Image property, or Settings.AppearancesSmall.Appearance.Image, depending on the item style.