| | |
HELP please!!vb.net help.....
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2005
Posts: 17
Reputation:
Solved Threads: 0
hello,i need to make an if statement for a mortgage application in vb.net, basically i have a list box for the DOB called cmbDOB, and a label to show the maximum mortgage. But i dont know how to make the if statement-it has to show the maximum mortage in the label depending on the following:
but my list box has the DOB's as follows - 1940......to....1985. anyone good at writing vb.net language and wanna help me!!!!!please!!!!!!!! :o
•
•
•
•
*Over 50yrs- maximum mortage = 15yrs
*between 40 - 50 = 20yrs
*Between 30 - 40 = 25
*betwen 18 - 30 = 30yrs
*Under 18yrs - NO mortgage!
•
•
Join Date: Jun 2008
Posts: 7
Reputation:
Solved Threads: 0
you can use if statements.
If [your condition here]
Your code here
ElseIf [your condition here]
Your code here
ElseIf [your condition here]
Your code here
Else
Your code Here
End If
for more follow this link
http://vb.net-informations.com/progr...else_endif.htm
If [your condition here]
Your code here
ElseIf [your condition here]
Your code here
ElseIf [your condition here]
Your code here
Else
Your code Here
End If
for more follow this link
http://vb.net-informations.com/progr...else_endif.htm
To do this properly, I would focus on allowing the user to select their birthdate with a datetimepicker....or, convert their choices from your listboxes to a date.
You will need to insert error handling and other specifics on your own, as well as adjust the accuracy of the age...but this is very close to what you need.
You will need to insert error handling and other specifics on your own, as well as adjust the accuracy of the age...but this is very close to what you need.
VB.NET Syntax (Toggle Plain Text)
Public Class Form1 Dim intage As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim dtdob As New Date(Me.ListBox1.SelectedItem.ToString, 1, 1) ' using this method of calculating the age of the client is inaccurate, but the ' function I used offers more granularity for calculating an exact age...you can tweak it. intage = Microsoft.VisualBasic.DateAndTime.DateDiff(DateInterval.Year, dtdob, Now) populatelistboxitems(intage) End Sub Private Sub populatelistboxitems(ByVal intage As Integer) Me.ListBox2.Items.Clear() Select Case intage Case Is >= 50 Me.ListBox2.Items.Add("10 year mortgage") Case Is >= 40 Me.ListBox2.Items.Add("10 year mortgage") Me.ListBox2.Items.Add("20 year mortgage") Case Is >= 30 Me.ListBox2.Items.Add("10 year mortgage") Me.ListBox2.Items.Add("20 year mortgage") Me.ListBox2.Items.Add("25 year mortgage") Case Is >= 18 Me.ListBox2.Items.Add("10 year mortgage") Me.ListBox2.Items.Add("20 year mortgage") Me.ListBox2.Items.Add("25 year mortgage") Me.ListBox2.Items.Add("30 year mortgage") End Select End Sub End Class
Last edited by cutepinkbunnies; Aug 2nd, 2008 at 3:09 am.
![]() |
Similar Threads
- Freelance .NET / MS SQL developer (Web Development Job Offers)
- .Net Application Developer (Software Development Job Offers)
- .net Software Engineer (Software Development Job Offers)
- .NET Consultant (Software Development Job Offers)
- Software Engineer (.NET , SQL) (Software Development Job Offers)
- ASP.Net / C# Web Developer (Web Development Job Offers)
- ProgrammersTalk.net Recruiting Forum Posters (Internet Marketing Job Offers)
- .NET developers team searches projects (Post your Resume)
Other Threads in the VB.NET Forum
- Previous Thread: Want to run vb prg in vb.net
- Next Thread: Generating Random Passwords with ASP.NET and VB
Views: 2797 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2005 2008 access account application array arrays basic beginner browser button buttons center checkbox client code convert cuesent data database datagrid datagridview date datetimepicker design designer dissertation dissertations dissertationtopic eclipse excel fade filter forms generatetags gridview html images input insert intel internet lib listview mobile monitor net objects open panel passingparameters pdf picturebox port position print printing problem read remove richtextbox save searchvb.net select serial settings shutdown sorting sqlserver studio survey table temperature textbox time timer timespan transparency update user validation vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web webbrowser winforms wpf wrapingcode year





