
wrxdriven
Members-
Posts
16 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by wrxdriven
-
i need to add a blank line every 12 lines..
-
how do you insert a line break in a listview? i need to make it insert only every 12 lines. also i need to insert and make the same line break work in an html file that is created at the same time. Can you tell me how that might work? thanks
-
how would i go about taking a while loop that prints to a listview also print to an html table in the same format with the press of a button? Thanks so much
-
ok so i have come this far with my program. I want it to do a few more things that i just can't seem to figure out. here it is. I want to check the input to make sure they are numeric before making the schedule. I want to also make the html file look just as the listview does. And lastly the loop for the listview needs to end at 0 for the principalbalance and currently it does not. How can i adjust the loop? Thank you so much for all the time... Imports System.IO Public Class Form1 Inherits System.Windows.Forms.Form Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim sReader As IO.StreamReader '///use the System.IO.StreamReader / System.IO.StreamWriter rather than the FreeFile method. Dim path As String = "C:\syst2010\program1.cfg" Dim sLine As String Try sReader = New IO.StreamReader(New IO.FileStream(path, IO.FileMode.Open)) While Not sReader.Peek sLine = sReader.ReadLine Select Case sLine.Split("=")(0) '/// the text to the left of the = symbol. Case "loan" Me.txtLoanAmount.Text = (sLine.Split("=")(1)) '/// the value at the right of the = symbol. '/// do what you want to the value ( eg: add to textbox called Loan ) Case "interest" Me.txtInterest.Text = (sLine.Split("=")(1)) '/// and so on... Case "years" Me.txtYears.Text = (sLine.Split("=")(1)) Case "payment" Me.txtPayment.Text = (sLine.Split("=")(1)) Case "HTML" Me.txtFileLocation.Text = (sLine.Split("=")(1)) End Select End While sReader.Close() Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub Private Sub btnCalculateLoan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculateLoan.Click 'print to loan ' Make sure the Purchase Price and Down Payment have values If Me.txtInterest.Text = Text.Empty Then MessageBox.Show("Enter An Interest Value") ElseIf Me.txtYears.Text = Text.Empty Then MessageBox.Show("Enter Amount of Years") ElseIf Me.txtPayment.Text = Text.Empty Then MessageBox.Show("Enter Monthly Payment") ElseIf Me.txtFileLocation.Text = Text.Empty Then MessageBox.Show("Enter a Save Location") Else : Me.txtLoanAmount.Text = Me.txtPayment.Text / ((Me.txtInterest.Text / 1200) / (1 - (1 / (1 + (Me.txtInterest.Text / 1200)) ^ (Me.txtYears.Text * 12)))) End If 'print to lvschedule Dim myvar As Double = IsNumeric(False) Dim MonthlyPayment As Double Dim MonthlyInterest As Double Dim TotalInterest As Double Dim TotalPayments As Double Dim Months As String Dim InterestRate As Double Dim Month As String = Now.Month Dim InterestPaid As Double Dim payment As Double Dim newMonthlyInterest As Double Dim PrincipalBalance As Double Dim InterestBalance As Double Dim ListItem As New ListViewItem() ' Set local variables based on inputs Months = Me.txtYears.Text * 12 PrincipalBalance = Me.txtLoanAmount.Text InterestRate = Me.txtInterest.Text InterestPaid = (Me.txtLoanAmount.Text * (InterestRate / 1200)) payment = Me.txtPayment.Text ' Calculate the Monthly Interest MonthlyInterest = (InterestRate) / 1200 ' Calculate computation results MonthlyPayment = (-MonthlyInterest * PrincipalBalance) / _ ((MonthlyInterest + 1) ^ (-Months) - 1) ' Set "Results" fields txtLoanAmount.Text = Format(PrincipalBalance, "Currency") 'clear listview Me.lvwschedule.Items.Clear() ' Calculate the monthly values and fill the listview Dim year As String = Now.Year Dim number As Double Dim newmonth As String Dim i As Integer Dim currMonth As Integer = DateTime.Now.Month Dim currYear As Integer = DateTime.Now.Year Dim myDates(6) As String Dim principalpaid As Double Dim MyMonth As Integer Dim Name As String 'MyMonth = 4 'Name = MonthName(MyMonth, True) ' "True" returns an abbreviated name. 'MsgBox(Name) ' Name contains "Apr". 'ListItem = New ListViewItem(number) 'ListItem.SubItems.Add(year) 'ListItem.SubItems.Add(Format(Month, "short date")) 'lvschedule.Items.Add(ListItem) Do Until PrincipalBalance <= 0 number = number + 1 For i = 0 To PrincipalBalance = 1 myDates(i) = currMonth & " " & currYear If currMonth = 12 Then currYear += 1 currMonth = 1 Else currMonth += 1 End If Name = MonthName(currMonth, True) 'Select Case currMonth ' Case "1" ' currMonth = "Jan." ' Case "2" ' currMonth = "Feb." ' 'continue doing this for each month 'End Select InterestPaid = (PrincipalBalance * (1 + InterestRate / 1200)) _ - PrincipalBalance payment = Me.txtPayment.Text InterestBalance = InterestBalance + InterestPaid principalpaid = payment - InterestPaid PrincipalBalance = PrincipalBalance - principalpaid ListItem = New ListViewItem(number) ListItem.SubItems.Add(currYear) ListItem.SubItems.Add(Format(Name)) ListItem.SubItems.Add(Format(payment, "Currency")) ListItem.SubItems.Add(Format(InterestPaid, "Currency")) ListItem.SubItems.Add(Format(principalpaid, "Currency")) ListItem.SubItems.Add(Format(PrincipalBalance, "Currency")) lvwschedule.Items.Add(ListItem) Next Loop Dim filenum As Integer Dim filename As String = (Me.txtFileLocation.Text) 'Get the next available file number filenum = FreeFile() 'Open the file that we can write to FileOpen(1, filename, OpenMode.Output) 'Write to the file PrintLine(1, "<HTML>" & vbCrLf & "<BODY BGCOLOR=" & "green" & ">" & vbCrLf & "<HEAD>" & vbCrLf & "<TITLE>" _ & "Amortization Schedule" & "</TITLE>" & vbCrLf & "<link rel=" & """listview""" & Space(1) & "type=" & _ """text/css""" & Space(1) & "href=" & """cssname.css""" & ">" & vbCrLf & "</HEAD>" & vbCrLf & "<BODY>" & _ vbCrLf & "<P>" & Me.lvwschedule.Text.Clone & "</P>" & vbCrLf & "</BODY>" & vbCrLf & "</HTML>") End Sub Private Sub btnCalculatePay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculatePay.Click 'print to payment Me.txtPayment.Text = Me.txtLoanAmount.Text * ((Me.txtInterest.Text / 1200) / (1 - (1 / (1 + (Me.txtInterest.Text / 1200)) ^ (Me.txtYears.Text * 12)))) ''amortization schedule 'Dim i As Integer 'Dim year As Integer 'Dim month As String 'Dim balance As Integer 'Dim principle As String = (balance * (Me.txtInterest.Text / 1200)) 'Dim interestpaid As String = (Me.txtPayment.Text - principle) 'balance = Me.txtLoanAmount.Text End Sub Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click Me.txtFileLocation.ResetText() Me.txtInterest.ResetText() Me.txtLoanAmount.ResetText() Me.txtPayment.ResetText() Me.txtYears.ResetText() Me.lvwschedule.Items.Clear() Me.txtLoanAmount.Focus() End Sub Private Sub lvschedule_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lvwschedule.SelectedIndexChanged End Sub End Class
-
can anyone tell me how to print a listview from a windows form to an html page with the same formating as the listview? Also how do you format a number into a month i format currency like this in the listview ListItem.SubItems.Add(Format(payment, "Currency")) and i can't figure out how to do the month i tried it like this but it doesn't work ListItem.SubItems.Add(Format(currMonth, "MMM"))
-
how do i format the month to go from a number like 1 to the jan abbreviation? Thanks
-
can anyone help me with this date problem? I have to write an amortization schedule to a listview box. There are some headers on the top that have to do with the systems date ie now. I need to loop some sort of structure that will count down months with their abbreviation which i can't seem to figure out. Also i need to count down years in accordance with the date. As the months drop to dec then the next jan it will be a year higher. when i run the program it needs to load the values that the computers clock has set. so i need the months to read line by line starting with lets just say it is todays month which is nov and then the year 2003, then the next month with 2003, and then as jan comes the year is 2004 and so on. What do i have to do in my loop? THanks
-
can anyone help with aligning a bunch of separate columns in a listbox? I need about six columns. (num, date, id, price, etc...) i want the right data to appear in each column in a loop. Does anyone have an amortization schedule that prints out to some listbox or something like that? Thanks
-
I ahve a windows for that i want to start up and fill in text boxs with a default . Here is my file it is a .cfg file. [schedule] loan=250000 interest=4.25 years=30 payment=1229.85 HTML=c:\syst2010\schedule.html I want it to read line by line into my text boxes such as loan=250000 goes into the Loan txt box. Please help me... thanks
-
Thank you that really helped
-
how do i get the folder that the file i picked in a savedialog is from. i.e. c:/desktop/ftop/mytext.html i want to display in a text box c:/desktop/ftop/ help me please' Thanks
-
Here is my problem I have to create a class by the name of GUI then inside Create a form that allows the user to set the following elements of an HTML page: Background color Title Header text at the top of the page. Allow the user to set the font (color, font file, size, bold, italics). Body text. Allow the user to set the font (color, font file, size, bold, italics). The user should also specify the location (on the hard drive) of the html and css file. They should go in the same folder. After the user has set the above criteria: The program should check all user input to make sure it is valid. None of the inputs can be left blank. The program should notify the user which pieces of information need to be filled in. Use a Cascading Style Sheet to set the font and color of the H1 (Header) and P (paragraph) tags. This will be a separate file and should be referenced by the HTML page. Use dialog boxes to allow the user to specify the desired fonts and colors of the text and the location of the HTML Page. can anyone help me get started on this? What is a Cascading Style Sheet and how does it work? Do i start by adding buttons and what not to the form? Please i need help Thank you
-
Here is what the final procedure needs to accomplish. It Receives a string and returns an ArrayList. The string represents the location of the CD.txt file. here is an example of the text.txt file. 100;All That You Can't Leave Behind;U2;16.99;34;00005.jpg The procedure will read the text file and create a CD object for each CD in the file. The file has one CD per line. is this doing what i am asked? I guess just copy and paste it. It has a lot of chicken scratch in it but is does run. If this is not right then what do it do? It needs to be a function i guess. Sub Main() Dim arrlst As New ArrayList() Dim cddisk As CD Dim filenum As Integer = FreeFile() Dim filename As String = "C:\mydocuments\text.txt" Dim disk As New CD() Dim str As String() Dim limiter As String = ";" FileOpen(filenum, filename, OpenMode.Input) 'Dim j As Integer 'For j = 0 To 1 Dim arr As String() Dim i As Integer Do Until EOF(filenum) 'Read one line of the line Dim test As String = (LineInput(filenum)) arr = test.Split(limiter) For i = 0 To arr.GetUpperBound(0) Console.WriteLine(arr(i)) Next Loop 'Close File FileClose(filenum) Console.ReadLine() 'Dim i As Integer 'For i = 0 To 5 ' arr = str.Split(limiter) ' 'Console.WriteLine(arr(i)) 'Next disk.setid(arr(0)) 'disk.settitle(arr(1)) Console.WriteLine(disk.GetID) 'Console.WriteLine(disk.GetTitle) 'Dim disk As New CD(arr(0), arr(1)) arrlst.Add(disk) 'Next 'For j = 0 To arrlst.Count 'cddisk = arrlst(j) 'Console.WriteLine(cddisk.GetID()) 'Console.WriteLine(cddisk.GetTitle()) 'Next Console.Read() End Sub thank you for your help.
-
Yeah i need help in a bad way. I am just not that proficient in arraylist and i want to make this work right. Do you have any building blocks or maybe some suggestions as to where to start Thank you
-
I am creating a console app for my cd collection I already created a class called CD I am having trouble coming up with the appropriate procedure to do the following. I am not sure what to do from here. I know i want it to recieve the string (which is the location of the cd.txt) and recieve an arraylist full of CD objects. The procedure will create a text file and store all the CD information in the ArrayList to the file in the exact same format as this 128;Heart, Soul & A Voice;Jon Secada;12.99;4;00032.jpg (128 is the call number; then name; then artist;price i paid;quantity;image cover call) If you need more info or if i didn't make myself clear let me know. Thank you all
-
I am trying to build a program for my brothers birthday. I am drawing a blank for this procedure for a program i am building. I want the procedure to repeat whatever string he types in as many times as it is characters long. So "Frog" would repeat four times. it will probably print on a console.writeline() Thank you so much cheers