Wrox Programmer Forums
|
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 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 April 29th, 2006, 11:19 AM
Authorized User
 
Join Date: Mar 2006
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
 
Old April 30th, 2006, 09:11 AM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 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
 
Old April 30th, 2006, 03:12 PM
Authorized User
 
Join Date: Mar 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Rod

For some reason I had not noticed those two


Jon Masterson
 
Old May 1st, 2006, 07:29 AM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox Problem Brendan Bartley Access 4 November 26th, 2007 01: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





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