Populating A Listbox Collection Thru An Inputbox
Feb 9, 2009I am creating a glossary of words used in a study course. I would like to populate listbox with words entered into an imputbox.
View 8 RepliesI am creating a glossary of words used in a study course. I would like to populate listbox with words entered into an imputbox.
View 8 Replieswhat it does iswhen a user checks an item in the checked list box it transfer it to a listboxso i have a checked list box and a listboxi am planning to put another listboxwhat i would like to be able to do is thatwhen the user checks an item on the checked list box it will transfer the item into the listbox [like the one on my previous thread]and be able to show an messagebox with a textbox [ i read its called an input box ] or another form with a textbox and/or combo box will pop up
View 13 RepliesDim A As Collection
Set A = New Collection
Dim Arr2(15, 5)
[Code].....
How can I access the Arr2 through A? For example, I want to do the following:
A.Item(1) (1,1) = 15
so the above would change the first element of the first two-dimensional array inside the collection...
I am populating a collection from some tables in the database which serves as a look-up from controls (combobox) I am using but what I want is rather than hitting the database each time can I just cache the collection and get the collection from the cache? The look-up table may or may not change all the time so I would want to have a way to validate if the cached collection is still valid or not.
View 2 RepliesI am trying to create a basic quoting tool but got stuck on how to clear and change the item collection from within a combobox for a datagrid.What we have is a list of 4 columns like a. Device b.TypeofService c.State d.Price Inside a sql database. Data is also structure like above as well.
I have a datagridview where the user will populate a,b,c and the price will be display and a total at the end. However a,b, and c aren't related in my current application. The combobox will show all possible dinstinct values for each column.
This works fine but I want to refine the application to only show the values of b. which are in the database after the user select the value for a. I have tried searching on how to do this as I assume to the Contry/State/City situation but could not find anything for a datagridview control in VB.NET.
Can anyone point me in the right direction? If I cannot do this dynamically from within a datagridview I was thinking of maybe creating three combo box outside and having it populating the datagridview afterwards but it wouldn't be as nice.
My assignment involves wrinting an airline reservation brogram where the user can hit a make reservation button and the user can then input passenger name departure city and arrival city, all of this has to print to a multiline textbox, the professor also wants a find reservation button and a cancel reservation button.
Public Class Form1
Sub get_data()
Dim passengername As String = InputBox("please enter passsenger name")
Dim departure As String = InputBox("please enter departure city")
[code].....
I am trying to make an application that would use an inputbox that will enter numbers until the user enters -1 after the numbers were entered and the user entered -1 the numbers would display within the listbox and the average would be in a label displaying "The average number is" & averagenumber in my current application I have it from 1-5 my question is how would i allow it to enter an unknown amount of numbers and create an counter for it.
Public Class Form1
Private counter As Integer
Private item As Double
Private average As Double
Private numbers As Double
[Code] .....
I am using VB.NET (version 2008). I have two types of items populating in a listbox (checked listbox). For example: lets say one is type "A" and other is "Type B". Their names maybe same so if the user sees those items in listbox then he won;t be able to determine their type until he click on them and checks out its properties. I wanted that I add each item to listbox and colour them so that blue for example means type "A" is there and red means the other. So this way I will be able to know at a glance that how many item of what type is present. I guess it may not be possible to do that in a standard checkedlistbox. I am also using component factory's krypton controls which enhance the gui of an application. But I dunno if I can progress using that.
View 5 RepliesI have an assignment that asks me to:
1. create a button
2. when that button is clicked, an inputBox will appear to ask the user how many words they will enter.
3. then display an inputBox for each word.
For example, when the first inputBox appears, I enter "3" (meaning that I will enter 3 words).Then there should be 3 more inputBox (each inputBox allows me to enter only 1 word)After I enter the third word, there will be no more inputBox.How can we FLAG (stop) the inputBox, or let the inputBox know when to stop showing up?
I have to convert what i put into an input box, and somehow convert that into an array.
My project is to put in some random numbers from an inputbox into a listbox, then somehow converting those numbers into an array and find the median of those numbers. I'm able to do the math, and I'm sure its probably 2 or 3 lines of code
I am trying to populate a listbox using 65000 words in a text file for a hangman game, I have looked everywhere for information but cant seem to figure it out. I am using visual Basic 2010, I read something about IO.streamreader but could not figure it out. I created a txt file in my.resources with all the words i want to use to populate the listbox. I also saved a notepad version of the list in my debug folder for my project.
View 14 RepliesI am working on Visual Studio 2005, VB.At the back end,there is a table called "Marks" which has a column called "Subject". This column contains duplicate values.when the form loads,I want to display all the distinct values from the "Subject" column in the listbox.
View 2 RepliesI want to be able to populate LB3 with data from LB2 that does not exist in LB1. i.e. Fred is in LB2 but not in LB1 so on button click, Fred will appear in LB3. Here's what I have so far:Private Sub Button6_Click(sender As System.Object, e As System.EventArgs) Handles Button6.Click
[Code]...
The idea is to click Button1, for it to open a browser window, then select 1 or more files from a directory and add them to ListBox1.Currently I'm using a very basic method that adds all files from a directory to my ListBox
Dim files() As String = IO.Directory.GetFiles("C:Users")
ListBox1.Items.Clear()
For Each file As String In files
[code].....
is there any way to populate a listbox with totals data from previous pages? I'm working on a project for a class where the final form needs to have all the totals from the previous 3 pages (each page has one total each), in some capacity (so I do not necessarily need to use a listbox if there is an easier way to do this).One thing about the previous 3 forms, two are set up in radiobuttons and one is set up w/a checkbox format (but I will likely change the radiobuttons over to checkboxes as a later revision).I just can't figure out how to populate the listbox with info from a previous form, I keep thinking load events, but that doesn't take into account which options might be taken from previous forms.once the totals from the previous forms have been added to the final form I will need to add a 7% sales tax. I assume that something such an if then statement will take care of that though.Just wanted to run that everyone here at the forum just in case there is a better way to do that.
View 2 RepliesQuick question on the InputBox. I am just learning this, what is the code to "read" commands that are placed from the Inputbox? I can do this in the command line: System.Console.Writeline(), System.console.Readline()
I just would like to know how read the line from the inputbox. Also when I debug my script do I -always- need to have the command prompt in the background?
I have a class with a collection of objects of type clsCDImage
clsAllCDs:
Imports System.Data.OleDb
Public Class clsImages
Private mAllCDimages As New Collection
[Code].....
I am trying to add numbers. So if there are 2 numbers in a listbox, theyare summed up. If there are 3 numbers in a listbox, they are summed up
[Code]...
What I'm trying to do is to count the number of items. Then I start my counter at 0. For each time the counter goes up, I add another row from the list box. and loops until my counter reaches the number of items in my listbox. I'm stuck intTotal. The only way I know of adding the totals is lstCosts.Items(0)+lstCosts.Items(1)+lstCosts.Items(3). But what if the user enters 4 numbers? I can't find a way around that. I think this should be a very simple question and I think only this line needs to be changed.
I'm in the process of creating my own version of the Combo Box as MS version does not give me the flexibility I need, this is work fine. I just had a little niggle
The List box contains/uses ObjectCollection to hold all its objects, but it does not have the facility to inform by the way of events that an item has been added etc.
If I inherited from this collection could I add the necessary code to make this happen, I have done this in my previous controls I�ve created when I wanted this facility.
Currently, I have a listbox lstInventory where I have loaded some database information from a .mdb file. I am able to add new records, and they all display correctly.
Yet, I can't seem to retrieve or access any of the listbox items. (Not trying to reaccess database in here, yet). I am hoping to "Edit" an existing database record by matching it to the lstInventory's selecteditem property. Unfortunately, I am not able to retrieve anything (tried traditional CType(lstInventory.selecteditem.ToString, String) approach, as well as a debug.write approach (which I can't seem to display, even with a Listener-which is another issue in itself).
Furthermore, when I check the listbox.items.count property, it prints out as a "0" [using a messagebox.show()]
I have tried searching multiple forums, but found lots of "database into listbox" threads, and the MSDN website hasn't helped me yet. Do I need to know the collection's name (what would it's name be based on ?)? Or am I not converting the object into a printable/countable quantity?
I'm creating an open-source web browser in VB.NET Express 2008 and I've created a User Setting named History to save a collection of strings for the browsing history. However, when I try to load the history form at runtime, only the first item (of the three I added) shows up in the listbox. Below are both examples of code I have tried to use to accomplish this task.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ListBox1.DataSource = My.Settings.History
[Code]....
I cannot find how to display an error message when what I typed in the listbox field is not in the listbox collection.
For example the listbox contains the following items
1) Apple
2) Strawberry
3) Mango
If for example I type "Mongo" and then press tab to another field, a message will pop up saying I typed something not in the listbox. Anyone who knows how to code if text in textbox1 is not in listbox then blah blah blah.
I'm trying to create a favorite box in my web browser using this code in Favorites.vb
Public Class favorites
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
[Code]....
Now I have it so when you click the add button it will put the URL in the string FavList, and place the URL in Listbox1 however I have no idea how to save it, and load it.
So the next time the user opens it, it will have the URL in the string and URL box, so when they click the URL in listbox1 it will redirect the WebBrowser. I think it works like that already I just need to know how to save it, and load it.
Is there a way to to combine line's 1 and 2? I only want to loop through a list of the selected items in this listbox. This works just fine, I just wondered if there was a collection of selected values returned that I could use to avoid having to do it this way.
For Loop1 = 0 To MyListBox.Items.Count - 1
If MyListBox.Items(Loop1).Selected = True Then
...
End
Next
Is it possible to have a texttbox autocomplete source set to a listbox's collection? I see:
FileSystem
HistoryList
RecentlyUsedList
AllUrl
AllSystemSources
FileSystemDirectories
CustomSource
in the texxtbox's autocompletesource property but are unable to make it happen.
using a Binding Source to Bind my Collection to a ListBox? I can bind the class to the binding source, but im not sure how to let it know what type of list it is, or how to display the correct item.
I'm trying to get the listbox to display the ItemNames. Here's my class and collection class.
<System.Serializable()> Public Class SurveyItem
Private itemNm As String
Property ItemName() As String
[Code]....
I would like to populat the Listbox collection from a column from a Access database I already created the name of the collection as collections. I can autocomplete/Suggest a Textbox with no issues.[code]
View 2 RepliesI want to retrieve the selected items in a listbox, save them to a collection, and then use that collection later. I thought that was simple enough, but when I clear the selected items in the listbox, my collections (items, indices) change. I found this out by stepping through the code.
Basically what I'm wanting to do is move items in the listbox up or down (up in this case), and still keep them selected.
[Code]...
Is it good practice to store sub-collections of item X inside a parent collection of item X for caching 'filter-queries' which are performed on the parent collection? (They won't be used together (as in color AND type).) Or is it also ok to just Loop over the collection and return the correct entities in a temporary collection?
[Code]...
I have the following classes:
Product, Service and OrderItem
Product and Service must inherit OrderItem. So basically I want to store OrderItem object in my shopping cart and these object are store in a list.
Public MustInherit Class OrderItem
Private m_enuItemType As TypeOfItem = TypeOfItem.None
Private m_strUserID As Integer[code].....