Bgrove83
November 25th, 2005, 12:15 PM
Hi all i'm new to the site but here goes. I'm having 2 different problems:
1.) I'm trying to make my cursor change to the "appStarting" cursor when one of my child forms is opening. I can't seem to make it work, i've tried using the RaiseEvent method but that didn't seem to work for me.
2.) I am using save and open dialog boxes Everything works fine I can save and I can open and fill all the labels and text boxes with the info. The problem comes when i try to do new operations with the information. It just replaces what's in the textbox and never uses the information.
This is my code for the open dialog
Try
With openCheck
.Filter = "Text files (*.txt)|*.txt|" & "All files|*.*"
'setting filters so that Text files and All Files choice appears in the
'in the dialog
If .ShowDialog() = DialogResult.OK Then
'showDialog method makes the dialog box visible at run time
FileName = .FileName
sr = New StreamReader(.OpenFile)
'using streamreader to read the opened text file
lblBal.Text = sr.ReadLine.ToString()
countDeposit = Integer.Parse(sr.ReadLine)
summaryInstance.txtDeposit.Text = countDeposit.ToString
totalDeposit = CDec(sr.ReadLine)
countGas = Integer.Parse(sr.ReadLine)
totalGas = CDec(sr.ReadLine)
countFood = Integer.Parse(sr.ReadLine)
totalFood = CDec(sr.ReadLine)
countMisc = Integer.Parse(sr.ReadLine)
totalMisc = CDec(sr.ReadLine)
End If
End With
Catch es As Exception
MessageBox.Show(es.Message)
Finally
If Not (sr Is Nothing) Then
sr.Close()
End If
End Try
I can post my code used for the save if it will help...i think my problem is somewhere in the assignment of the streamreader but I'm not sure...sorry for the long post and I can't seem to find how you format your code on here so i'ts going to be hard to read but any help is very much appreciated
1.) I'm trying to make my cursor change to the "appStarting" cursor when one of my child forms is opening. I can't seem to make it work, i've tried using the RaiseEvent method but that didn't seem to work for me.
2.) I am using save and open dialog boxes Everything works fine I can save and I can open and fill all the labels and text boxes with the info. The problem comes when i try to do new operations with the information. It just replaces what's in the textbox and never uses the information.
This is my code for the open dialog
Try
With openCheck
.Filter = "Text files (*.txt)|*.txt|" & "All files|*.*"
'setting filters so that Text files and All Files choice appears in the
'in the dialog
If .ShowDialog() = DialogResult.OK Then
'showDialog method makes the dialog box visible at run time
FileName = .FileName
sr = New StreamReader(.OpenFile)
'using streamreader to read the opened text file
lblBal.Text = sr.ReadLine.ToString()
countDeposit = Integer.Parse(sr.ReadLine)
summaryInstance.txtDeposit.Text = countDeposit.ToString
totalDeposit = CDec(sr.ReadLine)
countGas = Integer.Parse(sr.ReadLine)
totalGas = CDec(sr.ReadLine)
countFood = Integer.Parse(sr.ReadLine)
totalFood = CDec(sr.ReadLine)
countMisc = Integer.Parse(sr.ReadLine)
totalMisc = CDec(sr.ReadLine)
End If
End With
Catch es As Exception
MessageBox.Show(es.Message)
Finally
If Not (sr Is Nothing) Then
sr.Close()
End If
End Try
I can post my code used for the save if it will help...i think my problem is somewhere in the assignment of the streamreader but I'm not sure...sorry for the long post and I can't seem to find how you format your code on here so i'ts going to be hard to read but any help is very much appreciated