Click here to Skip to main content
15,881,281 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Class of Classes! Pin
Mel Padden21-Jul-06 4:46
Mel Padden21-Jul-06 4:46 
AnswerRe: Class of Classes! [modified] Pin
mr_lasseter21-Jul-06 10:57
mr_lasseter21-Jul-06 10:57 
GeneralRe: Class of Classes! Pin
Alex Feature23-Jul-06 19:29
Alex Feature23-Jul-06 19:29 
AnswerRe: Class of Classes! [modified] Pin
mr_lasseter24-Jul-06 2:30
mr_lasseter24-Jul-06 2:30 
QuestionDownload Files From FTP Server Pin
skysunil20-Jul-06 23:33
skysunil20-Jul-06 23:33 
AnswerRe: Download Files From FTP Server Pin
Robert Rohde20-Jul-06 23:57
Robert Rohde20-Jul-06 23:57 
GeneralRe: Download Files From FTP Server Pin
skysunil24-Jul-06 18:19
skysunil24-Jul-06 18:19 
QuestionListView exception - stumped! [modified] Pin
nzmike20-Jul-06 23:29
nzmike20-Jul-06 23:29 
Hi all,

I have a ListView control on a VS2003 WinForm which I am populating successfully with JPEG images using the LargeIcon setting. This works fine so I added code to handle the SelectedIndexChanged event so when the user clicks on one the icons (ie: the images displayed as thumbnails) the full image will appear in another tab. (The ListView MultiSelect property is turned off BTW)

Ok, so this works perfectly the FIRST time... but when I try to select any image after that I get this error (marked in the code below where it occurs):

An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in system.windows.forms.dll

My event handler is below - anyone know what the heck is going wrong here?!!? My listview still seems to have all it's items and the correct indexes as well so I'm simply stumped as to what's going on.

Mike

PS: I'll google as well but I have a big deadline so any help will be appreciated!



Private Sub lvwImages_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lvwImages.SelectedIndexChanged

Dim ndx As Integer = lvwImages.SelectedItems(0).Index 'CODE FALLS OVER HERE!!!!
Dim strImagePath As String = lvwImages.Items(ndx).SubItems(0).Text 'The image filename
Dim img As Image = Image.FromFile(strImagePath)

'picFullImage is a Picturebox control on another tab.
picFullImage.Width = img.Width
picFullImage.Height = img.Height
picFullImage.Image = img

End Sub

-- modified at 5:31 Friday 21st July, 2006
AnswerRe: ListView exception - stumped! Pin
Dave Sexton20-Jul-06 23:54
Dave Sexton20-Jul-06 23:54 
GeneralRe: ListView exception - stumped! [modified] Pin
nzmike20-Jul-06 23:59
nzmike20-Jul-06 23:59 
GeneralRe: ListView exception - stumped! Pin
Dave Sexton21-Jul-06 0:52
Dave Sexton21-Jul-06 0:52 
AnswerRe: ListView exception - stumped! Pin
mr_lasseter21-Jul-06 11:02
mr_lasseter21-Jul-06 11:02 
GeneralRe: ListView exception - stumped! Pin
nzmike21-Jul-06 15:40
nzmike21-Jul-06 15:40 
QuestionCD scanning Pin
jinal_pandya20-Jul-06 23:18
jinal_pandya20-Jul-06 23:18 
AnswerRe: CD scanning Pin
Dave Sexton20-Jul-06 23:44
Dave Sexton20-Jul-06 23:44 
QuestionHow do I send RTF formated mail using VB.NET? Pin
govind yadav20-Jul-06 23:06
govind yadav20-Jul-06 23:06 
QuestionSQL compare date problem on VB Pin
campbells20-Jul-06 22:19
campbells20-Jul-06 22:19 
AnswerRe: SQL compare date problem on VB Pin
Paddy Boyd20-Jul-06 23:11
Paddy Boyd20-Jul-06 23:11 
GeneralRe: SQL compare date problem on VB Pin
campbells20-Jul-06 23:13
campbells20-Jul-06 23:13 
GeneralRe: SQL compare date problem on VB Pin
ChandraRam25-Jul-06 19:14
ChandraRam25-Jul-06 19:14 
GeneralRe: SQL compare date problem on VB Pin
ChandraRam25-Jul-06 19:15
ChandraRam25-Jul-06 19:15 
QuestionProblem with display of unicode characters with Crystal report Pin
Sithy20-Jul-06 22:00
Sithy20-Jul-06 22:00 
QuestionQuestion about notification among controls Pin
jgyie220-Jul-06 22:00
jgyie220-Jul-06 22:00 
AnswerRe: Question about notification among controls Pin
Rizwan Bashir21-Jul-06 5:30
Rizwan Bashir21-Jul-06 5:30 
GeneralRe: Thanks. Does Observer design pattern or others support that? Pin
jgyie221-Jul-06 6:29
jgyie221-Jul-06 6:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.