I have recently bought the Wrox VB
.NET 2003 book ISBN 0764556584, which is great! I have entered some code from Chapter 4, page 105, Using Select Case Project.
Private Sub lstData_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstData.SelectedIndexChanged
' what did you choose?
Dim name As String
[red]name = lstData.Items(lstData.SelectedIndex)[red]
' use a select case to do something...
Dim favoriteColor As String
Select Case name.ToLower
Case "darren", "edward"
MessageBox.Show("Male", "Select Demo")
Case "stephanie", "cathy", "zoe"
MessageBox.Show("Female", "Select Demo")
MessageBox.Show("I don't know the ************ of this person.", _
When I run the project I get the following ERROR > [red]C:\Documents and Settings\Gary & Jackie\My Documents\Gary\Programming\Vbnet\Select Case\Select Case\Form1.vb
(64): Option Strict On disallows implicit conversions from 'System.Object' to 'String'.[red] The error relates to the line name = lstData.Items(lstData.SelectedIndex)above.
Now here's my problem.....when I download the exact same code from the website it works! (I have Strict on for that code too)!
Any ideas...it's driving me mad! :(