Please help!!iv tryed and tryed with this!basically i have a combo box which displays the date-of-births from 1940-1995, and a button to press to display the maximum mortgage in a label. The max mortgage depends on the age of client:
*Over 50yrs- maximum mortage = 15yrs
*between 40 - 50 = 20yrs
*Between 30 - 40 = 25
*betwen 18 - 30 = 30yrs
*Under 18yrs - NO mortgage
and this is wot iv got for my code,but it underlines the "lblMortgage" part, but i dont know how else it can be written??any1 help me??:
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbDOB.SelectedIndexChanged
cmbDOB.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Dim i As Integer
For i = 1940 To 1995
cmbDOB.Items.Add(i)
Next i
End SubPrivate Sub btnMortgage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMortgage.Click
Dim thisyear As Integer = 2005If thisyear - cmbDOB.Text > 50 Then
lblMortgage = "mortgage years are 15"
ElseIf thisyear - cmbDOB.Text <= 50 And thisyear - cmbDOB.Text >= 40 Then
lblMortgage = ("mortgage years are 25")
ElseIf thisyear - cmbDOB.Text <= 40 And thisyear - cmbDOB.Text >= 30 Then
lblMortgage = ("You maximum morgage years are 25")
ElseIf thisyear - cmbDOB.Text <= 30 And thisyear - cmbDOB.Text >= 18 Then
lblMortgage = ("You maximum morgage years are 30")
ElseIf thisyear - cmbDOB.Text < 18 Then
lblMortgage = ("You are to young to get a morgage")
End If
lblMortgage.Text = thisyear - cmbDOB.TextEnd Sub
End Class