Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Visual Basic 2005 Programmer's Reference
This is the forum to discuss the Wrox book Visual Basic 2005 Programmer's Reference by Rod Stephens; ISBN: 9780764571985
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2005 Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 29th, 2006, 11:19 AM
Authorized User
 
Join Date: Mar 2006
Location: Devizes, Wilts, United Kingdom.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Listbox problem

Hi Rod

Thanks for solving my previous problem. Currently I am stuck with the behavior of a listbox. The listbox has multiple extended selection. I also have a couple of navigation buttons to move the current selected item up and down. With single selection this works fine by using .selectedIndex and changing it.

.selectedIndex does not seem to work when the selection mode is multiple. The .selectedindices collection is readonly. The only way I can get it to work is to change the selection mode to single and back again. This causes the listbox to flicker and re-write itself so that is not practical.

Any suggestions much appreciated

thanks


Jon Masterson
__________________
Jon Masterson
Reply With Quote
  #2 (permalink)  
Old April 30th, 2006, 09:11 AM
Rod Stephens's Avatar
Wrox Author
Points: 2,726, Level: 21
Points: 2,726, Level: 21 Points: 2,726, Level: 21 Points: 2,726, Level: 21
Activity: 50%
Activity: 50% Activity: 50% Activity: 50%
 
Join Date: Jan 2006
Location: , , .
Posts: 566
Thanks: 1
Thanked 75 Times in 74 Posts
Default

Use the SetSelected and GetSelected methods. (I have no clue why they didn't use properties instead of methods for this.) Take a look at this example:

    http://www.vb-helper.com/howto_net_s...selection.html


Rod
RodStephens@vb-helper.com
Author of "Visual Basic 2005 Programmer's Reference"
http://www.vb-helper.com/vb_prog_ref.htm
Reply With Quote
  #3 (permalink)  
Old April 30th, 2006, 03:12 PM
Authorized User
 
Join Date: Mar 2006
Location: Devizes, Wilts, United Kingdom.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Rod

For some reason I had not noticed those two


Jon Masterson
Reply With Quote
  #4 (permalink)  
Old May 1st, 2006, 07:29 AM
Rod Stephens's Avatar
Wrox Author
Points: 2,726, Level: 21
Points: 2,726, Level: 21 Points: 2,726, Level: 21 Points: 2,726, Level: 21
Activity: 50%
Activity: 50% Activity: 50% Activity: 50%
 
Join Date: Jan 2006
Location: , , .
Posts: 566
Thanks: 1
Thanked 75 Times in 74 Posts
Default

No Problem. They're kind of hidden. Using the Get/Set syntax is unusual.


Rod
RodStephens@vb-helper.com
Author of "Visual Basic 2005 Programmer's Reference"
http://www.vb-helper.com/vb_prog_ref.htm
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox Problem Brendan Bartley Access 4 November 26th, 2007 12:34 PM
ListBox problem aliirfan84 ASP.NET 2.0 Professional 5 May 28th, 2007 08:39 AM
listbox problem faizee36 Access VBA 4 April 27th, 2006 09:58 AM
ListBox Problem spacy ASP.NET 1.x and 2.0 Application Design 2 October 18th, 2004 05:45 AM
A ListBox problem csc820203 C# 6 June 15th, 2004 06:45 PM



All times are GMT -4. The time now is 02:38 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.