Wrox Programmer Forums
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 30th, 2006, 09:04 PM
Registered User
Join Date: Oct 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default simple listbox question

I am very new to VB.NET, just started taking a class in school... my background is in web development primarily.

Anyway, what I am trying to figure out today is, I have a form created with a listbox. I want the users to be able to make a selection from the list box and then click a button, and then depending on what they selected from the listbox, something would be displayed in a label on another part of the form. The premise of the application is that is 'translates' the vague error messages a user might give a support tech, into what they really meant to say. How do I code the listbox and button?:)

Old October 2nd, 2006, 07:59 AM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

In the event handler for your button click do something like this:

Dim item as new listitem

For each item in listbox1.items
   if item.selected then
    'Do something here
   end if

--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

Similar Threads
Thread Thread Starter Forum Replies Last Post
simple question petergoodman XSLT 8 July 18th, 2008 07:57 AM
Simple Question ironchef Spring 2 April 30th, 2007 09:32 AM
Simple Question ironchef Java GUI 0 September 14th, 2006 04:56 PM
Simple Question JEHalm BOOK: Beginning Access VBA 0 December 29th, 2005 10:42 AM
Simple question happyheart_man Pro VB.NET 2002/2003 0 January 14th, 2004 11:38 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.