We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Listview Selected Item error

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.

2
Contributors
8
Replies
6 Hours
Discussion Span
6 Months Ago
Last Updated
11
Views
Question
Answered
LD Company
Light Poster
30 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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

john.knapp
Posting Whiz in Training
221 posts since Oct 2012
Reputation Points: 25
Solved Threads: 22
Skill Endorsements: 3

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

LD Company
Light Poster
30 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Clean your solution first, then zip and upload entire project

john.knapp
Posting Whiz in Training
221 posts since Oct 2012
Reputation Points: 25
Solved Threads: 22
Skill Endorsements: 3

Here is:

Download

LD Company
Light Poster
30 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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

john.knapp
Posting Whiz in Training
221 posts since Oct 2012
Reputation Points: 25
Solved Threads: 22
Skill Endorsements: 3

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

LD Company
Light Poster
30 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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

Thanks for helping me! ;)

LD Company
Light Poster
30 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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

john.knapp
Posting Whiz in Training
221 posts since Oct 2012
Reputation Points: 25
Solved Threads: 22
Skill Endorsements: 3
Question Answered as of 6 Months Ago by john.knapp

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.0791 seconds using 2.67MB