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
Attachments grid_sys-bat-netmeter.jpg 25.3 KB grid_sys_with_meter.jpg 24.08 KB grid_sys_with_meter.jpg 24.08 KB gridsys_full_feed.jpg 21.09 KB

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
This article has been dead for over six months. Start a new discussion instead.