Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

Dear all,

I am stocked in step e. See below. Can anyone help me? Thanks a lot.

I need to code an application that allows the user to display an image that corresponds to the item selected in a list box. Step a. open the image solution. step b. set the list box's sorted property to true. step c. create a new form-level collection named mpictureboxcollection. step d. in the form's load event procedure, add the cloudpiceturebox, lightingpicturebox,rainpicturebox,snowpicturebox, and sunpicturebox controls to the mpictureboxcollection. after doing so, fill the elementlistbox with the following items: cloud, rain,snow,sun,and lighting, then select the first item in the list.(hint: when adding the picture boxes to the mpictureboxcollection, assign a key to each picture box. Relate each picture box's key to the index of its associated item in the list box.) step e. code the list box's selectedvaluechanged event procedure so that it displays, in the elementpicturebox control, the image that corresponds to the item selected in the list box.

Below is the code that I have done so far

Private Sub ImageForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'add CloudPictureBox control to mPictureBoxCollection
mPictureBoxCollection.Add(Me.CloudPictureBox)

'add RainPictureBox control to mPictureBoxCollection
mPictureBoxCollection.Add(Me.RainPictureBox)
'add SnowPictureBox control to mPictureBoxCollection
mPictureBoxCollection.Add(Me.SnowPictureBox)
'add SunPictureBox control to mPictureBoxCollection
mPictureBoxCollection.Add(Me.SunPictureBox)
'add LightningPictureBox control to mPictureBoxCollection
mPictureBoxCollection.Add(Me.LightningPictureBox)
' Fill the elementlistbox with cloud,rain,snow,sun, and lighting
Me.ElementListBox.Items.Add("Cloud")
Me.ElementListBox.Items.Add("Rain")
Me.ElementListBox.Items.Add("Snow")
Me.ElementListBox.Items.Add("Sun")
Me.ElementListBox.Items.Add("Lightning")

End Sub
Private Sub ElementListBox_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ElementListBox.SelectedValueChanged

Edited by Robby

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...