Click here to Skip to main content
15,884,986 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: DateTime.Now.TimeOfDay Display Format Pin
Clark Kent12314-Dec-11 1:58
professionalClark Kent12314-Dec-11 1:58 
AnswerRe: DateTime.Now.TimeOfDay Display Format Pin
Luc Pattyn14-Dec-11 8:00
sitebuilderLuc Pattyn14-Dec-11 8:00 
Questionvb.net 2010 crystal report help Pin
alejx12-Dec-11 7:41
alejx12-Dec-11 7:41 
AnswerRe: vb.net 2010 crystal report help Pin
thatraja12-Dec-11 17:34
professionalthatraja12-Dec-11 17:34 
QuestionApplication Deployment Pin
jugnu_ad12-Dec-11 1:32
jugnu_ad12-Dec-11 1:32 
AnswerRe: Application Deployment Pin
Dave Kreskowiak12-Dec-11 8:34
mveDave Kreskowiak12-Dec-11 8:34 
AnswerRe: Application Deployment Pin
dr.kitanjal15-Dec-11 1:57
dr.kitanjal15-Dec-11 1:57 
QuestionArray not calculating correctly Pin
Member 847941811-Dec-11 11:25
Member 847941811-Dec-11 11:25 
I have assigned my combo box with the information needed but my code to calculate is not working my button need to compute the total of runners that is added from my .txt, the average age of the runners and the total funds raised. Help would greatly be appreciated, I have been going at this all week, Let me know if you need more info.

Public Class frmContributions

'Class Level Private variables
Private _intLifeOfItems As Integer = 5
Public Shared _intSizeOfArray As Integer = 21
Public Shared _strInventoryItems(_intSizeOfArray) As String
Private _strName(_intSizeOfArray) As String
Private _decAmountRaised(_intSizeOfArray) As Decimal
Private _intAge(_intSizeOfArray) As Integer

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'The Form1 load event reads the inventory text file and fills the Combobox object with the
'inventory items

Dim objReader As IO.StreamReader
Dim strLocationAndNameOfFile As String = "e:\earthdayrun.txt"
Dim intCount As Integer = 0
Dim intFill As Integer
Dim strFileError As String = "The file is not available. Restart when the file is available"

'Verify the file exists
If IO.File.Exists(strLocationAndNameOfFile) Then
objReader = IO.File.OpenText(strLocationAndNameOfFile)
'Read the file line by line until the file in completed
Do While objReader.Peek <> -1
_strName(intCount) = objReader.ReadLine()
_intAge(intCount) = CInt(objReader.ReadLine())
_decAmountRaised(intCount) = Convert.ToDecimal(objReader.ReadLine())
intCount += 1
Loop

objReader.Close()

For intFill = 0 To (_strName.Length - 1)
lstRunners.Items.Add(_strName(intFill))
Next
Else
MsgBox(strFileError, , "Error")
End If
End Sub

Private Sub btnCompute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCompute.Click
'The btnCompute click event calls the contribution Sub procedures
Dim intCountOfRunners(21) As Integer
Dim intFundsRaised() As Integer = {175.5, 534.0, 1023.0, 655.5, 178.0, 633.0, 135.0,
178.5, 500.0, 122.0, 190.25, 16.0, 721.0, 463.0, 15.0, 189.0, 78.0, 0.0,
602.0, 10.0}
Dim intAges As Integer
Dim intAdd As Integer
Dim intTotal As Integer
Dim decRunners As Decimal

For intAges = 0 To (intCountOfRunners.Length - 1)
intTotal += intCountOfRunners(intAges)


Next

For Each decRunners In intCountOfRunners
lstRunners.Items.Add(decRunners.ToString("C"))
Next

lblCountOfRunners.Text = intTotal.ToString("C2")
lblTotal.Text = (intTotal / intCountOfRunners.Length).ToString("C2")
AnswerRe: Array not calculating correctly Pin
Andy_L_J12-Dec-11 0:24
Andy_L_J12-Dec-11 0:24 
GeneralRe: Array not calculating correctly Pin
Member 847941812-Dec-11 8:39
Member 847941812-Dec-11 8:39 
AnswerRe: Array not calculating correctly Pin
Andy_L_J12-Dec-11 11:58
Andy_L_J12-Dec-11 11:58 
Questionsql query for filtering Access database by date Pin
Amanjot10-Dec-11 16:34
Amanjot10-Dec-11 16:34 
AnswerRe: sql query for filtering Access database by date Pin
JR21210-Dec-11 19:56
JR21210-Dec-11 19:56 
AnswerRe: sql query for filtering Access database by date Pin
Dave Kreskowiak11-Dec-11 3:27
mveDave Kreskowiak11-Dec-11 3:27 
AnswerRe: sql query for filtering Access database by date Pin
coded00711-Dec-11 21:35
professionalcoded00711-Dec-11 21:35 
QuestionVB.NET 2010, Form Close Question Pin
Framework .l.9-Dec-11 15:19
Framework .l.9-Dec-11 15:19 
AnswerRe: VB.NET 2010, Form Close Question Pin
Luc Pattyn9-Dec-11 15:34
sitebuilderLuc Pattyn9-Dec-11 15:34 
AnswerRe: VB.NET 2010, Form Close Question Pin
daveh604517-Jan-12 23:28
daveh604517-Jan-12 23:28 
QuestionConection lines without crossing other lines Pin
JR2128-Dec-11 2:20
JR2128-Dec-11 2:20 
AnswerRe: Conection lines without crossing other lines Pin
Luc Pattyn8-Dec-11 2:43
sitebuilderLuc Pattyn8-Dec-11 2:43 
QuestionTree view Pin
Member 84675328-Dec-11 0:46
Member 84675328-Dec-11 0:46 
AnswerRe: Tree view Pin
Simon_Whale8-Dec-11 0:56
Simon_Whale8-Dec-11 0:56 
QuestionConnection String for remote access database Pin
Vikash Yadav6-Dec-11 19:53
Vikash Yadav6-Dec-11 19:53 
AnswerRe: Connection String for remote access database Pin
DaveAuld6-Dec-11 20:13
professionalDaveAuld6-Dec-11 20:13 
GeneralRe: Connection String for remote access database Pin
Vikash Yadav6-Dec-11 20:39
Vikash Yadav6-Dec-11 20:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.