Multiple Listbox Selections?

Sep 18, 2011

I have 2 listboxes, listbox1 holds File names, listbox2 holds fullpath of the files(listbox2 is hidden just to keep things looking tidy).

What i want to do is (using multiselection) is select files in listbox1 and have listbox2 have the same files(indexes) selected as well.

i am rather new to this but i have tried several ways but listbox2 only selects the first selected file from listbox1.I am using vs2010 visual basic & wpf?

View 9 Replies


ADVERTISEMENT

VS 2005 ListBox Multiple Selections?

Oct 20, 2010

Working with a couple of listboxes to display userid and emailaddress. I am writing an application for viewing SSRS reports instead of using the Report Manager. I am able to select the report and also send an email to users with a web link to SSRS report so that ReportViewer comes up for them to view, export or print the report. Currently I am only able to send to one recipient and I'd like to be able to send to multiple recipients. However I am having difficulty with the multi-select from a listbox. I have set the SelectionMethod to MultiExtended and so I can select multiple items from the listbox. Here is my code -

[Code]...

and I also add a messagebox.show to display my values, in EmailAddressTo variable, it displays "System.Data.DataRowView" so it was not able to capture the email address at all. Then if I debug further I eventually get the error msg - "The specified string is not in the form required for an e-mail address." because of the empty variable. Using SelectedValue, I was able to get at least the first email address but not the second one.

View 4 Replies

Testing On Multiple Selections Made In A Listbox?

Apr 5, 2011

I am a new student of Visual Basic. I am using Vis. Studio 2010. Is there some sample VB code that I can gain access to that shows how to test on multiple selections that were selected within a listbox using the "For each" construct? In this scenario, multiple items have been selected but not 100% of them. I need to know how to test on which ones are selected as I examine each one in the list using the "For each" construct.

View 2 Replies

Replace Multiple Selections In Listbox With Textbox.text?

Oct 23, 2009

I have code that works to place two items in listbox into two textboxes when selected (multiple select extended).

Private Sub lstOutput_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstOutput.SelectedIndexChanged
Dim i As Integer = lstOutput.SelectedIndex

[code]....

I need also to be able to modify the data in the textboxes and replace the lines in the listbox. The reverse code doesn't work properly, it only replaces the first selected item. The "lstOutput.Items(i + 1)" appears not to lead to the second selected item.

Dim i As Integer = lstOutput.SelectedIndex
lstOutput.SelectedItem = lstOutput.Items(i + 1)
lstOutput.Items(i) = txtName.Text
lstOutput.Items(i + 1) = txtPhone.Text

I have scoured the web for ways to manipulate the selected index/indices, with no success.

View 8 Replies

Randomize Selections From Listbox?

Mar 11, 2010

im helping a school run a Spelling Bee aimed at children in year 7. And to make it fair and unbiased i need an application that can choose randomise a word from the list box then transfer the string to the text box.So basically something that can pick a random string from the listbox and show it in the textbox1.text property.

View 6 Replies

Retrieve ListBox Selections?

Aug 24, 2010

here's I've got:

Private Sub frm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim sql, pname, pid, pbrand, description[code]....

This adds the description to the listbox, no problem. How do I retrieve what's selected?I've gone over many documents on the subject, I kinda got it to work, but it gives me the entire description.... I just need the last value (3) to make it work.

View 5 Replies

Datagridview Multiple Selections?

Jan 7, 2010

i have a textbox1=Year and a textbox2=Month and a datagridview and as datasource access i want to know the code if i search for a year in databinding and how to look for a month of the focused year?

View 4 Replies

Multiple Selections In Text Box?

Sep 23, 2011

In a small app for demonstrating the use of Regular Expression matching in a text box, I have set it up so I can select one of the matches at a time in the text box to emphasise it. Is it possible to set up a text box so several isolated sections in the text is highlighted so all of the matches are highlighted at the same time. I'm thinking not and could use a picture box to do this but with all the hidden features in vb.net, I wanted to be sure since this would be very handy for my project and would be more useful for large amounts of text. I've read you can make multiple selections in the text box of a combo box.

View 4 Replies

Put MultiExtended Listbox Selections To Array?

Jan 14, 2010

I have a listbox with selection mode set to multiExtended. I want to put whatever is selected into an array, but I can't seem to figure out how to do it. Here is what I have so far, but with this code the selected values go into a single variable and not into an array so only the last item selected is stored.[code]....

View 4 Replies

MySQL Database Multiple Selections

May 31, 2010

I'm using this code to select all the IDs from the mysql database:[code]The command will return all the names. How can i process each one individually ?

View 6 Replies

Getting Multiple Selections From List Box To Display In The Results Label?

Nov 5, 2009

My name is Tim I'm having a problem getting my multiple selections from my list box to display in the results label and there is no examples in the text any how I'm thinking I need to use a loop to get it done. is this evern in the ball park?

Option Explicit On
Option Strict On
Option Infer Off
Public Class MainForm

[code].....

View 5 Replies

Preventing Duplicate Selections From Multiple Combo Boxes

Aug 6, 2009

Ive got 10 comboboxes on my form, each of them have the same items. I'm trying to get so that if I pick something from the first combo box it doesnt show up in the list for the 2nd box, etc. Also, I didnt want to just remove the item, incase the user changes their selection in a previous combobox. [code] Rest of the comboboxes have that last piece of code, with the boxes and stuff changed to the correct ones.

View 7 Replies

Preventing Duplicate Selections From Multiple Combo Boxes?

Jun 10, 2011

Ive got 10 comboboxes on my form, each of them have the same items. I'm trying to get so that if I pick something from the first combo box it doesnt show up in the list for the 2nd box, etc. Also, I didnt want to just remove the item, incase the user changes their selection in a previous combobox.Example of the code I used, as im on a different computer right now.

Code:
Dim cboList As New List(Of String)
Dim index1, index2, index3, index4, index5, index6, index7, index8, index9 As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

[code]....

Rest of the comboboxes have that last piece of code, with the boxes and stuff changed to the correct ones.Problem is that it doesnt remove the previous selections correctly.

View 2 Replies

Multiple Text Boxes And Combo Box Selections Output To Txt File?

Nov 1, 2009

I'm using Vb .net 2008

I could use some advice/examples to acheive the following:

I have 1 form, 4 text boxes, (textbox1 ,2, 3, 4)

Textbox1 and Text box 3 and single line text boxes.. Textbox2 is multiline.. (a description field which can be as long or short as the user desires..)

Textbox 4 is a large multi-line textbox that will contain the output of Textbox1,2,3.

I need to find out how to output the contents typed into Textbox1,2 and 3 into Textbox4 while maintaining formatting..

For example, contents of Textbox1 should always be the first text displayed in textbox4, immediately under that should be the contents of Textbox2, and under that, Textbox3

I want to ensure that the text is displayed in that order even if the user enters information into Textbox3 first.. and still displayed in the proper order if Textbox2 has 1 line of text or 20 lines of text.

How could I do this? How can I make the text from one box always be inserted before or After text from another specific textbox when its displayed in the destination Textbox.. (think of Textbox4 like a "preview window" of sorts.. which will later be outputted to an actual txt file.

View 1 Replies

Forms :: Select Multiple Value In Listbox A And Copy To Listbox B?

Jun 16, 2010

I have a question here.. pls kindly advise.I need to design a simple form that allow user to choose the value from Listbox A to Listbox B. For example, in Listbox A, have value A, value B and value C, then user can choose (or highlight value B and value C) and copy into the listbox B.

May i know how can i do this in vb.net? Any reference link?

View 2 Replies

Make Value Selections In Dgv?

Feb 23, 2010

i have a datatable named booking_table and i filled it with column names and values

Dim booking_table As New DataTable
booking_table.Columns.Add(
"Time", GetType(String))

[code]....

than the rowindex(0) I want it to start with "8:00" than for example the rowindex(47) should end with "19:00" extra info: every our is parted in four sections of 15 min for example 8:15, 8:30 ,8:45?i want to select the starttime by date.bind to DGV?

View 5 Replies

Dataset Doesn't Return The Selections?

Aug 17, 2010

im trying to get a selected time and my dataset doesn't return the selections what am i doing wrong in this statement

dim startindex as integer= 0
dim endindex as integer= 0
for each regel as datarow in my dataset.tables("Bookingen").rows

[Code].....

View 14 Replies

VS 2005 Displaying Checkbox Selections?

Mar 30, 2009

this gonna sound like a really basic problem but would some1 be able to tell how me to get a checkbox selection to be displayed as a peice of a text in a listbox or a text box.

View 13 Replies

C# - Persisting Date Selections When Visible Month Changes

Feb 21, 2011

Dim List As New List(Of DateTime)

Then in my button click event:

If InputBookinglength.SelectedValue.ToString = "2" Then
Dim paramstring As New StringBuilder
If Session("SelectedDates") IsNot Nothing Then

[Code]....

This code works fine when selecting multiple days in one month. But when you switch to display a different month, the previous months selections are lost. how to persist the selections when the visible month changes.

View 1 Replies

Code View Cannot Make Text Selections

Nov 23, 2009

Due to some settings changes, my code view cannot make text selections.

View 2 Replies

OnSelectedIndexChanged Not Working First Selection, But Will On Subsequent Selections?

Mar 24, 2012

I have a listbox in a datagrid that is supposed to update upon selection change, and it does, but not on first try. only after it has posted back, after the first time it is clicked will it work as intended.Here is the front end portion of the datagrid with the listbox.

<asp:TemplateColumn HeaderText="Qty">
<ItemStyle HorizontalAlign="Center" Wrap="False" CssClass="grid" />
<HeaderStyle HorizontalAlign="Center" ForeColor="Black" Font-Bold="true" CssClass="grid"

[code].....

View 1 Replies

Asp.net - Multiple Values From ListBox?

Jun 9, 2011

I am using asp.net with vb.net. I have created 2 listboxes; lstselect and lstroles. List boxes lstselect contains all of the available roles that can be added into lstroles. How do I take the roles that have been added into lstroles and make them into a parameter to pulled into my database when the stored procedure runs?

Here is the code for how my list boxes share the roles:

Protected Sub btnRight_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRight.Click
If lstselect.SelectedIndex <> -1 Then

[Code]....

View 1 Replies

.net - Groupbox Method Monitors Radio Button Selections?

Apr 22, 2010

I'm creating a VB.NET application that includes two radio buttons inside of a groupbox. If the first radio button is selected, a certain tab on a tab form should be enabled. If the second radio button is selected, that tab should be disabled.

Is there a groupbox method that monitors both radio buttons and fires when the selection changes? Or do I need to set up individual methods for each radio button?

View 1 Replies

Datagridview Selections Change Another Tables Binding Navigator?

Sep 12, 2010

Background: Not a developer by trade. I did however, endeavor to learn VB a few years ago and I got reasonably far but without proper motivation for the time, things were difficult to take further. Fast forward half a dozen years and while working with the sales team in my company, I noticed that they were struggling with cataloguing and tracking their calls to clients. They were all trying to use one excel spreadsheet to tabulate all the clients details and calls. Of course, this was a mess. So the idea is to build them a very simple database app that will allow multiple users to add entries to a db and we could pull reports from the data in the end to check performance and such.

Application: The application so far is a very simple access db with windows forms front end. Two tables, one holding &#65533;Client&#65533; data and the other &#65533;call&#65533; data. Idea being that we can now track multiple calls per client as opposed to just the next call as was the norm. Client and CallID are the primary keys of the table, with a clientID foreign key in tbCalls . There is one query which I tried to use to do this, which joins calls and clients so that I had everything in one table. Cool. There are four forms, basically frmCaptureClientInfo, frmSearchClients, frmScheduleCalls and frmMakeCalls. Most of these forms are working fine by just dragging the dataset fields onto the form and allowing the IDE to do the coding and then a little more code to validate that the inputs are correctothing fancy just add, delete, update is all this app does.

Issue: The last form is the killer form. Killer form, because it&#65533;s caused a huge rise in blood pressure. Anyway it sounds so simple. On the form is a datagrid that is populated with contents of above query (all client and call details), filtered by the parameter that checks if the call is complete or not. Sweet. Below I have dragged in fields from tblCalls. The &#65533;callers&#65533; need to edit three fields TimeCompleted, CallNotes and a call completed checkbox. What I need is the tblCallBindingNavigator to jump to the record that I have selected in the Datagrid view. Right now they are independent and I can&#65533;t join them. If this is at all possible?I have tried using just the query, which has the right behavior except the update command is not generated automatically. Spent Many hours researching updating queries but either was too complex for me to know it was the solution, or was for different products. If there is a way to do this then that would be awesome.I have also tried editing the CallBindingNavigator databindings settings but I am not sure what is going on there, it seems to block out the navigator controls. Here is some more info:

View 3 Replies

Disable Checkbox Selections In 2008 Winform Listview?

May 6, 2009

How do you disable additional checkbox selections/deselections without sacrificing the functionality of the ListView? I know you can call: ListView.Enabled = False, but that also disables any scrolling within it.

For example: I have a timer that starts a backup based on the Listview items that are checked. After a certain time, I don't want the end-user to be able to click on any of the checkboxes within the listview (so I have a set number of items to backup), but I do want them to be able to scroll the list while the backup is being performed. I tried this[code]...

View 3 Replies

Validating And Storing Selections From A Dataset Bound Combobox

Oct 20, 2009

I have a combobox that is bound to a dataset. The dataset has 3 columns of data. at any given time there could NOT be any data in the dataset.

When someone selects an item from the box I want to store data from 2 of the columns of the row they selected.I do the 'store' in the selectedindexchanged event.

so currently I am assigning each column/row value to a property from a datarowview i get from combobox.selecteditem.

Code:dim column1 = drv.row.item(0).tostringdim column2 = drv.row.item(1).tostring

But I am getting NullReference exceptions all over the place when there is not data.So i have to wrap it all in a try catch and assign nothing to the properties when the Null exception fires.

I want to also validate that there is a selection made. There must be a selection made if there is no data in the DS fill it.I do this in the combobox validate event.

It just seems like there is a better way to check for no data coming from the combobox.

I wish there was a way to do some sort of .count on the datarowview you get back from the combobox.selecteditem but anything i have found also gives a null ref exception if used.

Also what is used to programmaticly change the selected item?

View 5 Replies

Validating And Storing Selections From A Dataset Bound Combobox?

Mar 21, 2011

I have a combobox that is bound to a dataset.The dataset has 3 columns of data.at any given time there could NOT be any data in the dataset.When someone selects an item from the box I want to store data from 2 of the columns of the row they selected.I do the 'store' in the selectedindexchanged event.so currently I am assigning each column/row value to a property from a datarowview i get from combobox.selecteditem.

Code:dim column1 = drv.row.item(0).tostringdim column2 = drv.row.item(1).tostring

But I am getting NullReference exceptions all over the place when there is not data.So i have to wrap it all in a try catch and assign nothing to the properties when the Null exception fires.I want to also validate that there is a selection made. There must be a selection made if there is no data in the DS fill it.I do this in the combobox validate event.It just seems like there is a better way to check for no data coming from the combobox.I wish there was a way to do some sort of .count on the datarowview you get back from the combobox.selecteditem but anything i have found also gives a null ref exception if used.Also what is used to programmaticly change the selected item?.selecteditem.selectedtext.selectedindex.selectedvalue?

View 2 Replies

Add Student With Multiple Information In Listbox 

Jan 5, 2010

i have to add a student to my listbox but with many informations for example i have many textboxs (textbox for the age of the student, textbox for the name of the student & ECT) how can i had one student with all these infromation(age, name, major) in the load form also when i click on the student in listbox it shows age in the textbox1, name in textbox2 & ECT add student with multiple information in listbox [form load], and when i click on the student in the listbox it shows the students infromation on each textbox like textbox1 age, textbox2 name it's all with visual basic language.

View 7 Replies

Adding Multiple Items From One Listbox To Another?

Jul 12, 2011

I am able to only move single items from one listbox to another with this code. I tried with both MultiSimple & MultiExtended SelectionMode.

How do I select multiple items and then move them?
Private Sub cmdAdd_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs

[code]......

View 1 Replies

Adding Multiple Items To A Listbox?

Aug 10, 2011

(Visual Basic 2010)I'm trying to add multiple item to a listbox from a text file. The program will show help for computer tasks.

Textfile:

Add new event to calender#Sync calender to phone#Print something from the internet

Code:

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
UpdateTopicList()
End Sub

[code]....

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved