Forms :: Obtain Listbox Items From Another Form ?

Sep 15, 2011

I am using Visual Basic 2010 Express. I have 2 forms. A main form which does all the grunt work and then a small supporting form to get some additional user inputs.

Some program background...I am developing a program to characterize solid rocket motors based on test stand data for a hobby project. I load the time, thrust data into lists via a streamreader from a text box.

However, since the data is raw I would like for the user to select the "start" and "end" of the burn. I am currently trying to do it right after I load the data. As I read the data in, I just put it in the listbox of the supporting form as well. My main issue is, I need two values from the user. A start and end time. the index would probably be easiest, as I will rewrite the data list based on the time increment and delete everything before the first listbox selection and everything after the second selection. I can't get the values from the main form. I have exhaustively searched the internet trying to find something that I can apply. If someone could help with a framework on how to do this.

I understand how to get text from this text box on a different form, but this deals in variables and maybe setting up a class? I am having trouble communicating between the two forms.

View 1 Replies


ADVERTISEMENT

Forms :: Having Listbox'es And Their Items?

Aug 26, 2011

I have a listbox on my form, and a procedure that scans a certain directory for sub-directories, it then adds each subdirectory as a item in the listbox.

ex :

g:movies2010Clash of The Titans
g:movies2010Date Night
g:movies2010Red Dawn

[code].....

View 1 Replies

Forms :: ListBox.Items.add; How To Add At The Top?

Aug 16, 2010

I remember in the old VB6 that there was something simple as listbox.add("my string", 1 This '1' would meant the position I want it to be added, which means 'the top'I'm sure it sounds newbie... but hey, what a heck... I'm only been programming .net for a few months.

View 3 Replies

Forms :: Cant Remove Items From A Listbox

May 23, 2011

simple problem that i just cant figure out. here is the code

[Code]...

this code works fine as long as i dont remove ALL items, the error i am getting is index is out of bounds of the array, i have tried -1, -2 0 +1 +2 and all are still giving this error, i cant just create code for remove all as i wont always need all removed so i kinda of have to get this code or something similar to remove only checked items. the code below is code i have tried

[Code]...

View 4 Replies

Forms :: Get Items From Listbox Into Array?

Feb 16, 2010

I am trying to get the items out of a listbox and put into a text box .. I am putting the listbox items into an array and I keep getting this error: InvalidArgument=Value of '1' is not valid for 'index'. Parameter name: index

bolded code where this occurs here is my

Private Sub btn_BuildText_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_BuildText.Click
Dim delimiter As String 'Holds the String character representing the chosen delimiter
Dim i As Integer 'Loop counter

[code]....

View 6 Replies

Forms :: How To Paste Items Into ListBox

Jun 27, 2010

I'm using the following to add a list from a txt into a listbox, which works perfectly.
Dim OFD As New OpenFileDialog
OFD.Filter = "Text Documents (*.txt)|*.txt"
OFD.Title = "Open List"
OFD.ShowDialog()
ListBox1.Items.AddRange(IO.File.ReadAllLines(OFD.FileName))

The similar thing below does not work to load sites from the clipboard. What else could I use.
ListBox1.Items.AddRange(IO.File.ReadAllLines(Clipb oard.GetText))

View 6 Replies

Forms :: Listbox Items Do Not Refresh?

Jan 15, 2010

I am adding an object to a Listbox which has the properties "ID" and "Text". I have set the "DisplayMember" property of the Listbox to "Text" and "ValueMember" to "ID".Everything works fine when I add a new item to the list, but when I edit the item and change the "Text" value, it is changing in the object but the Listbox still just showes the original value.I have tried calling ".Refresh" and ".Update" to see if they worked, but made no difference.I usually use VB6 for prototyping programs but decided to use VB.NET for this one. Did not realise VB.NET got shot of the "ItemData" property in the ListBox control.

View 3 Replies

Listbox Items Colour - Two Types Of Items Populating In A Listbox (checked Listbox)

Apr 28, 2009

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 Replies

Forms :: Checking Listbox For Multiple Items?

Feb 17, 2011

I am making a virtual crafting application (similar to that done in Minecraft)

currently I have made a test "crafting recipe" which checks if the listbox (mixbox) has 1 window, 1 door and 1 wheel. the code looks like this:

If mixbox.Items.Contains("window") Then
If mixbox.Items.Contains("door") Then
If mixbox.Items.Contains("wheel") Then

[Code]....

View 3 Replies

Forms :: Drag Multiple Items From One Listbox To Another?

Mar 10, 2011

I've looked everywhere on the internet for multiple items drag&drop between listboxes and found only examples showing single item drag. I know how to make a single item dragdrop operation between two listboxes using MouseDown, DoDragDrop, DragEnter, DragDrop Now what I'm looking forward to learn is the ability of dragging more than one item from one listbox and dropping them in another listbox

View 2 Replies

Forms :: Filtering Similar Items In A Listbox?

Nov 30, 2010

I have a listbox already filled with links from a search engine. I am trying to filter out some of the links from the same domain:

Error http://abc.net.au/news/stories/test/index.html Test cricket - Wikipedia, the free encyclopedia <---- remove this link because same as first entry

[code]....

View 3 Replies

Forms :: Give Dynamic Items A Value In A Listbox?

May 15, 2009

I have a listbox that I am dynamically populating but I cant seem to add a value to the items.. the code is below

Small Issue also it would be nice to put both these tables into 1 dataset instead of the 2 I am using

[Code].....

View 5 Replies

Forms :: Show Listbox Items Into A Text Box?

Feb 2, 2009

i'm having issues trying to show listbox items into a text box. I have a list box item, when any of these items are selected from the collection (using VS.NET) i need that item to be shown in a text box.

View 5 Replies

Forms :: Adding The Files From Directory Into The Listbox In Items

May 10, 2009

We have a button, textbox and a folder browser... We made it so that when you click the button it shows the folder browser dialog.. And you choose your folder/path, then it shows the selected path in textbox.. We are succesful on this.. But now weve added a listbox, And when you selected the path it will do this..

[Code]...

View 2 Replies

Forms :: Loading Listbox Selected Items From A Database?

Sep 14, 2011

I was writing a program that would save the contents of a listbox to a database and wanted to reload the users' choices when the opened up that particular row again. My first thought was to do it with two for loops, just as I used to do in VB6, but I thought there must be a better way to do it. And there was. Sort of. It basically involves using the SelectedObjectCollection class.For this demo, you'll need a listbox called Listbox1. Set selection mode to something other than "One" or else it won't work as expected

Dim items(0 To 3) As String
items(0) = "One"
items(1) = "Two"

[code]......

View 1 Replies

Forms :: Make Listbox1 = Listbox 2 (all Items) Does Not Work

Feb 19, 2010

Basically on form2 i have a listbox. And on form3 i have 6 listboxes. I want listbox 2 to equal listbox (a listbox on form3) my current code does not work Private Sub formAustralia_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

[Code]....

View 3 Replies

Obtain The First And Last Items In A Queue?

Aug 20, 2009

Say I have a rolling collection of values where I specify the size of the collection and any time a new value is added, any old values beyond this specified size are dropped off.Obviously (and I've tested this) the best type of collection to use for this behavior is a Queue:

myQueue.Enqueue(newValue)
If myQueue.Count > specifiedSize Then myQueue.Dequeue()

[code].....

View 5 Replies

Add Items To A Listbox On A Form?

Jul 7, 2011

How can you add items to a listbox on a form? Also this needs to be included so if another item is added by user it will be added directly to database.

Reason i am asking that is my project has to work in cojunction with Oracle Plus.

So far if i remember it is something like

.Add("Horror")
.Add("Romance")

I'm unsure if that is correct but i want the items to appear so the user can select one from list.

I think you have to include a data reader but don't mind that i can handle that. All i want is to add items to listbox when form loads.

View 2 Replies

How To Add One ListBox Items To Another On Different Form

Jun 8, 2011

I have two forms with one listbox on each form. How can I show what I have in the listbox on form1 on form2. I have a button on form1 to go to form2.

Private Sub btnform2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnform2.Click
Form2.Show()
Dim sTemp As String = TextBox1.Text & ":" & textbox2.Text & ":" & textbox3.Text & ":" & textbox4.Text & ":" & textbox5.Text
Form2.ListBoxFonts.Items.Add(sTemp) 'add to the listbox
End Sub

But when I click the button it goes to the form2 but it only shows one list and nothing else. When I go to form1 to add another list, it comes up with the listbox on form2 with two list, but when I go to my form2, it only shows the latest one I put in, it never shows two or more list, its probably just one line of code.

View 3 Replies

Add Items To Another Form's Listbox From A Thread?

Apr 6, 2011

'Form 1- start a new thread and declare a new second form. Have it invoke before adding an entry. as this apart from "CheckForIllegalCrossThreadCalls = false" is a workaround.

Code:
Public Class Form1
Dim t As New Thread(AddressOf startanew)
Private Sub startanew()

[Code].....

View 2 Replies

Combo Box Items Send To New Form ListBox?

May 9, 2011

Our chapter is all on printing, but the teachers example sends the data to a new form, into a listbox. How do I take the contents of a ComboBox from one form and input it into the ListBox on another form, first adding the line "High School List".

I have this much, but then don't know how to read fromt he ComboBox. Not what is highlighted, but the full contents.

FrmPrint.Show()
FrmPrint.LstPrint.Items.Add("High School List")

View 3 Replies

Listbox Items Disappear When Form Is Closed?

Nov 22, 2009

I have a webbrowser I'm making, and my listbox items for form2 disappear once I close form2 and reopen form 2. However, once I restart the program (Close everything) and re-enter, the data is saved. But once I reopen the selected form, the listbox items are lost. Here is my code (It's long)

View 6 Replies

VS 2005 Map Listbox Items To Controls On The Form

May 4, 2010

i have two forms, one form is for accepting the details of the customer and other form is to export the customer details to excel. In the second form i have a listbox which contains all the names(rather captions) of the controls on the form1. like Items In Listbox -> Map onto control of Form1 customer Name -> txtcustomerName Address -> TxtAddress. What i want to ask is what is the best way to get the values from the form1 based on the selection(s) of listbox in form2

View 1 Replies

VS 2008 Listbox Items - Information Parsed To Another Form

Oct 23, 2009

I have some info in a listbox on another form. I want that information parsed to another form, and I would like to, for how ever many items there are in a listbox, create a button for every item and obviously parse the name to another label. I guess I would do this via an array.

View 2 Replies

Autoselect Pre-programmed Items In A Listbox When A Form Opens With The Control On It?

Aug 3, 2009

I am trying to autoselect pre-programmed items in a listbox when a form opens with the control on it.but i cannot find a proper method to select all the items in the listbox and hold the resulting text as a string that will later be saved to a text file. i do not need help with saving the text to file but rather selecting the items in the listbox.so, after alot of trial and error and no luck I think I am supposed to use

ListBox.ObjectCollection

propriety. but i have no clue whats so ever in how to manage to select all the items in the listbox when this form opens...if this does not make sence then I will rephraze it.

View 6 Replies

Forms :: Obtain The Height Of The Windows Title Bar?

Jan 14, 2011

Every windows window has an icon, title, minimize, maximize, close button. those rest on a bar. this bar's height changes from xp to vista to 7. how can i obtain it's height?

View 1 Replies

Forms :: Referencing All Items On Form With Handles Keyword?

Sep 15, 2011

I have a form in VB with many (over 100 - fields, labels, the form itself etc...) items on. I wondered if there was a way of refering to all the items on the form without having to list them all individually in the Handles keyword, which is extremely long winded! I want to carry out the same action wherever the user clicks on the form. At present I have the following

[Code]...

View 4 Replies

Forms :: Linking Comb Box Items To A Button To Load A New Form?

Jan 13, 2011

Linking Comb Box Items to a Button to load a new formCombo box 3 has 2 items.....Item 1, Item 2i want it so if you click on the button when item 1 is selected it will load form3 and if item 2 is selected the same button will load form 4

View 1 Replies

Cash Register Program With Separate Forms For The Items And The Display Form?

Jan 15, 2011

I have this cash register program with separate forms for the items and the display form. The code works untill you press the button 2x. It says 5.5 + 5.5 = 11.5??? Can you fix this code?

CashReg.ListBox1.Items.Add("Item 1")
Dim cash As String
cash = (5.5)[code]....

View 3 Replies

Forms :: Use The Textbox To Select An Item Form The Listbox

Aug 13, 2011

I'm trying to make an aplication in wich you'll use the textbox to select an item form the listbox If the listbox has:

[Code]...

View 5 Replies







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