Display The Lists Of Costs ?
Mar 20, 2011
Ok this is a hw assignment like always....just not sure on how to do the math on this form...the constants are declared for the registration fees and i did the same for the required days at each work shop i just need to find a way to multiply the days required at each workshop by the lodging fees. but i also need to display the lists of costs so its pretty complicated.
View 6 Replies
ADVERTISEMENT
Oct 14, 2009
This is what I'm trying to do: I have a listbox to display a list of costs that the user inputs. I want to use some kind of loop to add those numbers from the listbox sequentially, then display the total in a label.
How do I set up a loop (and what kind of loop is best) to pull the numbers and add them to a total? give an example of what the code might look like. I'm new to VB
View 6 Replies
Jun 26, 2011
I use a DataGridView to display filtered lists from a SQL data base.I've used this method on almost 100 Different objects.Today i'm getting a strange error from the DGV on only one of them, If you try to select an item in the list
[Code]...
View 5 Replies
Dec 20, 2009
I have two lists of strings. One is a list of all students in a class and the other is a list of students in the class that completed an assignment. The two lists are part:whole. So we have two loops for copying elements and displaying them in a list box for only the students who did submit.
Dim f As Integer
f = 0
Dim h As Integer
h = 0
While (usersinclass.Count > f)
h = 0
While (usersidthatsubmittedassingments.Count > h)
[Code] .....
What I need is the remaining portion of the "usersinclass" list. (i.e. The students who did not submit). I tried an Else statement BUT with nested loops, every element is guaranteed not to match at least once, so I was getting elements that shouldn't be there. So, is there anyway to run the given lists against each other again to pull out the remaining students? (preferably with no repeats).
View 1 Replies
Aug 15, 2008
I am trying to write a program in VB2008 Express. I originally wrote it in excel, but I want to add some features and make it a standalone executable. the program is ideal for a spreadsheet application though.
essentially, there are two input tables. each containing about 6 columns and maybe 10 rows. I assume that could be handled by arrays. the output would be a continuously updated table of output based on calculations using the data from the two input tables. the output table would be about 4 columns by up to 1000+ rows, and would need to be recalculated and displayed each time any data in the input tables has changed.
first, are arrays sufficient to handle this? would databases be more appropriate?
second, what's the best way to display a long list of output, that has a user defined length and is continually updated. it would also be nice to have the ability to click on an individual cell (or value) in the output and have more code executed.
is there a way to incorporate a spreadsheet like tool for this as a backend? I want to make sure i'm using the most efficient approach before i invest too much time.
View 1 Replies
Dec 27, 2009
I wish to read a web page that had various frames and div elements.To start with I would like to create a routine that justs lists all of those elements values and then display each element name and its value so I know what I have and how to reference it later on.I have been using the WebBrowser control and have managed to do a few basic things so far like go to a website and auto login.
View 2 Replies
Nov 29, 2009
I have the program written and it is so close to functioning correctly, but a the end where I am trying to add the totals for the costs.
[Code]...
View 19 Replies
Feb 26, 2010
Im creating a slot machine that costs 10 credits to use but i cant get it so that i can -10 credits from the total.
Heres my entire code:
Public Class frmFruitMachine
Dim OneCredit As Integer = 1
Dim FiveCredit As Integer = 5
[CODE].........................................
View 8 Replies
Nov 15, 2010
The project I'm working on is to write a program that requests an integer from 1 through 12 and then list the gifts for that day along with that day's cost. The program should also give the total cost for all twelve days combined. The items and price are in a text file called TwelveDays.txt.An example output is shown below:
The gifts for day 3 are:
1 partridge in a pear tree
2 turtle doves
3 french hens
Cost: $249.99
Total cost for the twelve days:
$78,100.30
How to read in the file and add the day costs together.
View 2 Replies
Apr 1, 2011
I have two lists. One list is a list of names, the other list is a list of how many times each name is found in the first list noted in the database
so...
Nick
John
Jim
Jack
is the firs tlist
10
13
13
2
is the second list. Nick had 10, john 13 and so on.I want to sort the second list from large to small, but have the index for the first list still linked to the correct amount of calls.i do it this way so I can
for x = 0 to num_of_names
string = lst_name(x) & "-" & lst_count(x)
next x
View 3 Replies
Aug 11, 2009
I've got 2 RTB one is for input of text and one is output.The output one needs to read the words from the input and display it alphabetically and with their line numbers.I have partly done it and it currently reads it but here is my problem When the words are outputted let say for example there are 2 words the same on the same line e.g the word 'you' appears twice on line one,at the moment its coming up like this
[Code]...
View 18 Replies
May 20, 2010
I know how to check whether an item exists in a list using (MyList.Contains), But I do not know how to check the whole list. For example (use one button and one richtextbox):
[Code]...
View 14 Replies
Jul 24, 2010
I would like to loop through two lists using a For each loop.
dim data as list(of pointpairlist)
For each recLine in records
For Each chan In recLine.channels and d in data
d.add( func(chan) )
Next
next
Note: each record line has one sample from each channel recorded. i.e. each record line is a slice of a 32 sensor recordings. I want to build up a x,y list of data points for each channel (the x axis is common to all channels). Is there some way to do it similar to what I have above (avoiding indexing variables).
View 2 Replies
May 13, 2011
I'm trying to populate one list from another. I would think this code should work, but at the end of the day I get a list of identical items.
Public Sub WriteDatFile(ByRef lstReasons As System.Collections.Generic.List(Of LetterReason))
Dim tmplstReason As New TCPService.LetterReason
[Code]....
View 2 Replies
Jun 6, 2011
I'm very new to programing and am having problems trying to perform some calculations with a list. I have read in an array into a list with a count attached to each item example: "xxxxxx(intcount)". What I'm trying to do it use two xxxxxx(intcount)'s at xxxxxx(intcount+5) and xxxxxx(intcount+25) and use these two variables to calculate yyyyyy(intcount) but it isn't working. I understand this may be a stupid question but could someone please point me in the right direction.
View 6 Replies
Mar 2, 2011
I have a method where I'm taking a generic object and using TypeOf to check what has been passed through. Now I would like to pass it a List(Of T) (T being anything) and no matter what T is I'd like to do the same thing to this list. I tried the following:
public sub foo(ByVal obj As Object)
if TypeOf obj Is List(Of Object) Then
'do stuff
end if
end sub
but this doesn't seem to work if I pass it List(Of String), say. I suppose that List(Of Object) and List(Of String) are being treated as different objects, but I thought that since String is an object, the comparision might work.
Now I realise that this is as ugly as sin and I'm better off overloading the method to take List(Of T) as its parameter, but I'm mostly asking out of curiosity: is there a way of comparing the types List(Of Object1) and List(Of Object2) and getting a positive result, since they are both just List(Of T)?
View 3 Replies
Feb 17, 2011
Compare differences between lists?I have two sets of lists below[code]...
View 1 Replies
Dec 17, 2009
I'm creating <!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-
[code].....
View 2 Replies
May 31, 2012
Right now I have a viewmodel that contains three lists of inputs; textboxinput, dropdownlistinput, and checkboxinput. Each of these lists is a list of input objects, which contain four values; paramenums, paramname, paramtype, and value. I am using these input lists to generate a variable number of fields on a form dependent on how many objects each list contains.
My current problem is that I'm not sure how to validate the variables in the list objects with fluent validation. I know how the behavior of each list should behave with regards to returning Nothing, but I don't know how to code that behavior with FluentValidation.
[Code]...
The thing I want to currently do is confirm that in every object in each of my lists, they all have a value attribute that isn't nothing. Can I do this by validating the input model? Right now, the code works at confirming that the list itself isn't null, but the objects in the list can still contain all null values. Is there a trivial way to do this? Alternatively, should I have set my code up differently?
View 1 Replies
Aug 27, 2011
<a href="http://www.websitename.com/Name" data-hovercard="/ajax/hovercard/user.php?id=100054545">Name</a>
how to grab, and lists all into a listbox?
View 1 Replies
Apr 12, 2011
I have referred to the following question at: Using foreach loop to iterate through two lists. My question is this, with regards to the chosen answer: Can the o.DoSomething be a comparison? As in:
For Each a in ListA.Concat(ListB)
If(a from ListA=a from ListB) Then
Do Something here
End If
Next
I'm using VB.Net and would like to know how I can do what I have shown here. That would basically be to iterate through a joined list separately/independently.
View 4 Replies
Jan 17, 2010
Is the size of Lists cached in some way (calculated the first time you call it, and then retained untill some change is made to it), or does it get calculated every time you call the Count property? Same question for arrays.
View 11 Replies
Sep 1, 2009
Can a list class in vb.net contain Data Structures ?
View 1 Replies
Jun 9, 2011
I have two Lists of custom objects:
List1: Year, Month, ValueA
List2: Year, Month, ValueB
I want to get a third List with a merge between the two:
List3: Year, Month, ValueA, ValueB
Is there any elegant way to perform that in LINQ VB.Net?
Example:
List1:
2010 - 6 - 2
2010 - 7 - 5
[Code].....
View 1 Replies
May 16, 2011
how I would be able to move a line from one list box to another?
What I need to do is read a text file, populate the lines in list boxes (automatically sorting them by set groups, defined in the text file).
Then I want to move the names between the boxes to my desire, the hit save and it will write them all back into the same text file.
View 2 Replies
Apr 5, 2011
I am fairly new to VB (have done some VB in excell, but its a bit different)
I have a couple of questions:
1) How do I populate a dropdown list from a Database Row 2?
2) When I create a Database from Acess, where do I save the database? and If I build the exe program later on, will it include the database, or how does it work? I feel completely stupid, but one of the best ways to learn is to try over and over again
View 2 Replies
Oct 23, 2011
I have 3 CheckListBoxes, and I want to save all of their "checked" states. I tried to change the code to save and load one to work for three, and this is what I came up with:
vb
Private Sub savechxlst()
Dim FileStream As New System.IO.FileStream("C:CheckedListBoxData.cld", IO.FileMode.Create)
[Code]....
Unfortunately, all this does is combine all of the checkboxes into one list (ChxLstSym), and leave the other lists (ChxLstAud and ChxLstEx) completely blank. By this I mean ChxLstSym ends up having 15 checkboxes instead of each of the 3 Lists having 5 checkboxes (Which is how it was before I saved and Loaded), though it does remember which boxes were checked originally.
Is there a way to fix this so that I can save and load the checked states for all three of the checklistboxes (ChxLstSym, ChxLstAud, and ChxLstEx) so that they are all in their own lists upon loading them?
View 5 Replies
Sep 14, 2011
I have a program that takes some data from a Dictionary object, runs a batch process on it and then puts the output into a second Dictionary. The issue that I'm having is that the batch process can only handle 1000 records at a time and sometimes the list is larger than that. Right now, I'm looping through the Dictionary, taking records 1 to 1000 and putting them into a Dictionaryof the same type to process, running the batch, looping through the results to add them to the second Dictionaryand then starting the loops again at record 1001.
Is there a more efficient way to do this to pull out the first 1000 records into another Dictionaryand then batch insert the results into the output Dictionary? It seems like the kind of thing there'd be a function for, but I'm not sure how to do it.
View 1 Replies
Jun 24, 2011
I have been assigned a program for homework in which I need to take in information about songs from a text file and then be able to sort the list alphabetically, by genre and by length. I also need to be able to filter it by genre. The user can then move songs they choose from the master list to a playlist where again the list can be sorted by either genre or play order.My book only covered sorting array when they are one dimensional however I need to be able to sort a multidimensional array by different columns. I asked my teacher but she had so much going on that we didn't really have time to get into it, so I decided to ask here.
I'm not looking for code, just to get pointed in the right direction. For instance rather than using a multidimensional array would it be better to pull the values in and then put them into an array of song objects with properties for each value? And if I choose to go that route is an array the best structure to use? I have to use an array of some type, but the problem says nothing about whether or not it can be a list or other array type structure.
View 6 Replies
Oct 19, 2011
I have the following function that combines objects based on their gameScore attribute [code]NOTE the function is in a different class than where I have the lists I'm giving it..I had to set all the game positions blank because it saw an object with the same ID but different position as a different object. I didn't realize that even though I passed in the list ByVal the code deletes the courses on the original list somehow.First I input the origonal list expecting it not to be altered and put the output as a new list.[code]Yet somehow even the last one deletes the gamePosition attribute on listGames BUT *Doesn't* do the sum funtion for them, why is this happening it doesn't make any sense, it shouldn't touch listGames
View 7 Replies