1,105,214 Community Members

Listview Selected Item error

Member Avatar
LD Company
Light Poster
30 posts since Aug 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hello programmers!

I made new software, LD File Browser. This software contains ListView but this ListView has error. Software works fine when I run it on F5 (debug), but when I run .exe icon I got error when I select different item in ListView. Here is the code:

TextBox1.Text = ListView1.SelectedItems(0).Text

and error image:

http://i.imgur.com/ejBHT.png

Now, all what I need is a valid code or way to make my software to allways ignore these erorrs. When I click continue, software still works but everytime when I select different item i got this dialog. How I can skip these error messages or just fix the code?

Thanks.

Member Avatar
john.knapp
Posting Whiz in Training
221 posts since Oct 2012
Reputation Points: 25 [?]
Q&As Helped to Solve: 22 [?]
Skill Endorsements: 4 [?]
 
0
 

This is that same project I already helped on, right?
If you zip and upload it to rapidshare, I'll take a look

Member Avatar
LD Company
Light Poster
30 posts since Aug 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Yes it is. This is last thing I need to fix. What you want to upload? Whole project or just files from /release folder?

Member Avatar
john.knapp
Posting Whiz in Training
221 posts since Oct 2012
Reputation Points: 25 [?]
Q&As Helped to Solve: 22 [?]
Skill Endorsements: 4 [?]
 
0
 

Clean your solution first, then zip and upload entire project

Member Avatar
LD Company
Light Poster
30 posts since Aug 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Here is:

Download

Member Avatar
john.knapp
Posting Whiz in Training
221 posts since Oct 2012
Reputation Points: 25 [?]
Q&As Helped to Solve: 22 [?]
Skill Endorsements: 4 [?]
 
0
 

To start with - you need Try...Catch blocks
The only one I see (other than the designer generated) is in Module1.GetShellIconAsImage

Member Avatar
LD Company
Light Poster
30 posts since Aug 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hmm. I still don't understand what I need to do. :/ Is there any way to disable these error messages?

Member Avatar
LD Company
Light Poster
30 posts since Aug 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hey! I fixed it! :D I changed event Listview1_SelectedIndexChanged to Listview1_Click! :D It works now! :D

Thanks for helping me! ;)

Member Avatar
john.knapp
Posting Whiz in Training
221 posts since Oct 2012
Reputation Points: 25 [?]
Q&As Helped to Solve: 22 [?]
Skill Endorsements: 4 [?]
 
1
 

I still highly recommend Try..Catch blocks in all your procedures.

Question Answered as of 1 Year Ago by john.knapp
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article