help with Inherits class

August 23, 2009 at 15:07:04
Specs: Windows XP
I am using VB 2008 for dummies and i am on page 72 i do not know how to do the inherits class can any one tell me how? here is what it says word for word from the book "You need a default value for the number of days. If the user doesn’t add anything
in the text box, the application must be able to set the interval value
to something. For now, define a new variable in the Code View. Under the
Inherits class definition, add a dimension statement like the following:
Dim DateInterval As Integer = 7"

See More: help with Inherits class

Report •

August 23, 2009 at 16:10:29
That's probably a leftover from VS 2003 for Dummies. The Inherits line is normally hidden from you. Just place the Dim under the Public Class line (unless there's an Inherits line just below that Public Class).

Report •

August 23, 2009 at 17:07:59
ok thanks i did that thank but still it is saying erro

Public Class DateCalc

Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateChooser.ValueChanged
If DateNumber.Text.Length > 0 Then
DateInterval = CInt(DateNumber.Text)
End If
NextWeek.Text = DateChooser.Value.AddDays(DateInterval).ToString()
End Sub

Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NextWeek.Click
Dim DateInterval As Integer = 7
End Sub

Private Sub DatePicker_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateNumber.TextChanged

End Sub
End Class

the bold words come up with an error saying:
Error 1 Name 'DateInterval' is not declared. line 5 column 13
Error 2 'DateInterval' is a type and cannot be used as an expression line 7 column 51

this is how it is set up, any ideal what it is i am doing wrong?

Report •

August 23, 2009 at 18:00:17
It's looking for the "Dim DateInterval As Integer = 7" line and not finding it.

Report •

Related Solutions

August 23, 2009 at 18:03:43
I was not but i happen to get the on the VB for web site and that author of the book had notice that as and error and posted were to put it thanks for the help here

Report •

Ask Question