473,378 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

About WebForm ListBox question ?!

Dear All,

I used ListBox(SelectionMode=Multiple) to develop my web application, but I
encountered some problems..

1. I can use ClearSelection method to unselect all the selected items but
how shoud I do if I want to select all the items of the ListBox.
2. Is there a better way to get all the selected item which user select,
because I think to scan all the item selected property is not very suitable.

Thanks....

Regards,
Paul
Nov 20 '05 #1
1 1051
Hi Paul

1.)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim lbi As ListItem

For Each lbi In ListBox1.Items

lbi.Selected = True

Next

End Sub

2.)
ListBox1.Items.CopyTo(myItems, 0)

HTH - OHM


"Paul Tsai" <mj*@seed.net.tw> wrote in message
news:Os**************@tk2msftngp13.phx.gbl...
Dear All,

I used ListBox(SelectionMode=Multiple) to develop my web application, but I encountered some problems..

1. I can use ClearSelection method to unselect all the selected items but
how shoud I do if I want to select all the items of the ListBox.
2. Is there a better way to get all the selected item which user select,
because I think to scan all the item selected property is not very suitable.
Thanks....

Regards,
Paul

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: cloverme | last post by:
Hi, I need help populating a listbox from a database on a webform. I created a an access database with a table, fields and data. Then I created a WebForm in vb.net and added a DropDownList...
1
by: Chris | last post by:
Hi, I have an application written in ASP and I am converting to ASP.NET in the old ASP page users can add items to a listbox control. When the user hits the "submit" command button on the...
0
by: Paul Tsai | last post by:
Dear All, I used ListBox(SelectionMode=Multiple) to develop my web application, but I encountered some problems.. 1. I can use ClearSelection method to unselect all the selected items but how...
1
by: Tom Wild | last post by:
Hi I have a listbox on a webform which has Autopostback set to true. When the user selects an item in the listbox and the form reloads, the listbox scrolls to put the selected item as high up...
2
by: Matt Theule | last post by:
I need to be able to allow users to drag files to a list box on a web page. To this end, I created a Windows Control and hosted it in a WebForm. When the file is dropped onto the listbox, the...
1
by: cloverme | last post by:
I have a couple of questions about coding (using vb.net) to a webform. Thanks in advance for your help. I'm a little new to vb.net, but a VB veteran. 1) When the page loads, how can I...
1
by: Kristian | last post by:
Hello, When clicking on a button the selected item from the 1st listbox is supposed to be added to the 2nd listbox: The code: Private Sub btnInfo_Click(ByVal sender As System.Object, ByVal e As...
3
by: James Radke | last post by:
Hello, I was curious, is it possible to create drag and drop interface from listbox to listbox on a webform application (i.e. vb.net)? Basically the application would need to load multiple...
9
by: James Radke | last post by:
Hello, I would like to create a sorted listbox which has one property that I can set to true or false to show if the listbox should be sorted (I may potentially add another one for the sort...
1
by: mikev | last post by:
Hi all I have a listbox which is 5 rows high. There are 5 list items. The first one is selected. I wish to click on a button and have the selection focus on the listbox removed. Removed,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.