TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
flipnjme
NA
15
0
checking for selection in listbox
Jul 26 2004 10:46 AM
I'm trying to check if a value from a list box is selected, right now if a value isn't selected and some one clicks add "I get specified argument was out of range of values". I figure maybe an if statement would work to check if anything was selected before the code is executed. Here is the code I have. public void Add_Click(object sender, System.EventArgs e) { ListViewItem item = listView1.SelectedItems[0]; Form1.FileSel = textBox1.Text; Form1.FileSize = item.SubItems[1].Text; Form1.selected = 1; this.Close(); } any help would be greatly appreciated.
Reply
Answers (
2
)
Use of Multiple Test Expressions in an 'If' Statement
Simple Remoting Q