none
How to take items in Combo box from list view columns RRS feed

  • Question

  • Hi,

    How to take items in Combo box from list view columns.

    Private Sub Form9MemberConnection_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim q As Integer
            For q = 0 To NumJ - 1
                ComboBox1.DataSource = Form8JointsCoordinates.ListView1.Items(q)
            Next
        End Sub

    Kind Regards,



    Hany Metry


    • Edited by Hany Metry Tuesday, April 28, 2020 2:40 AM
    Tuesday, April 28, 2020 2:38 AM

Answers

  • Hi,

    the correct solution code as shown below.

    Private Sub Form9MemberConnection_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim q As Integer
            For q = 0 To NumJ - 1
                ComboBox1.Items.Add(Form8JointsCoordinates.ListView1.Items(q).Text)
            Next
        End Sub

    Kind Regards,



    Hany Metry

    • Marked as answer by Hany Metry Tuesday, April 28, 2020 2:59 AM
    Tuesday, April 28, 2020 2:59 AM

All replies

  • Hi,

    The following code add the items while it include listviewitems

    word beside the number

    Private Sub Form9MemberConnection_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim q As Integer
            For q = 0 To NumJ - 1
                ComboBox1.Items.Add(Form8JointsCoordinates.ListView1.Items(q))
            Next
        End Sub

    How to remove list view items words


    Hany Metry

    Tuesday, April 28, 2020 2:53 AM
  • Hi,

    the correct solution code as shown below.

    Private Sub Form9MemberConnection_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim q As Integer
            For q = 0 To NumJ - 1
                ComboBox1.Items.Add(Form8JointsCoordinates.ListView1.Items(q).Text)
            Next
        End Sub

    Kind Regards,



    Hany Metry

    • Marked as answer by Hany Metry Tuesday, April 28, 2020 2:59 AM
    Tuesday, April 28, 2020 2:59 AM