Dear all

I have combox accumated with 3 perameter

Grid Connected PV-SYS- Full Feed In
Grid Connected PV-SYS with Electrical Appliance -Net Metering
Grid Connected PV-SYS with Electrical appliance ,battery system -Net Metering

Each combobox value contain images.I used picture box to dispaly images.
How to display the image based on Selction of sting from Combobox

I have attached image for reference

Public Class Climate_Form

    Private Sub Climate_Form_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim selectedItem As String

        selectedItem = ComboBox_TypeOfSys.SelectedItem()

        If selectedItem = "Grid Connected PV-SYS- Full Feed In" Then
            PictureBox_FullFeed.Show()
            PictureBox_NetMeter.Hide()

        End If

        If selectedItem = "Grid Connected PV-SYS with Electrical Appliance -Net Metering" Then
            PictureBox_FullFeed.Hide()
            PictureBox_NetMeter.Show()
        End If


        'Try
        '    PictureBox_FullFeed.Image = Image.FromFile(ComboBox_TypeOfSys.SelectedItem.ToString)
        'Catch ex As Exception
        '    MessageBox.Show("error  display images")
        'End Try


    End Sub


End Class

Use

Private Sub ComboBox_TypeOfSys_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox_TypeOfSys.SelectedIndexChanged
    PictureBox_FullFeed.Image = Image.FromFile(ComboBox_TypeOfSys.Text)
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.