I have a list with these words { AutoSize,Normal,StretchImage,CenterImage,Zoom }
Firstly my users will select one item from the list and after i need to change the property SizeMode of my picture box as their selection.
Can i make something without use of if/switch-case statements ?
If (size_mode_list.SelectedText = "AutoSize") Then
picture_box.SizeMode = PictureBoxSizeMode.AutoSize
ElseIf (size_mode_list.SelectedText = "Normal") Then
picture_box.SizeMode = PictureBoxSizeMode.Normal
ElseIf (size_mode_list.SelectedText = "StretchImage") Then
picture_box.SizeMode = PictureBoxSizeMode.StretchImage
ElseIf (size_mode_list.SelectedText = "CenterImage") Then
picture_box.SizeMode = PictureBoxSizeMode.CenterImage
ElseIf (size_mode_list.SelectedText = "Zoom") Then
picture_box.SizeMode = PictureBoxSizeMode.Zoom
End If