Computing.Net > Forums > Programming > help with Inherits class

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

help with Inherits class

Reply to Message Icon

Name: JJ_grant1220
Date: August 23, 2009 at 15:07:04 Pacific
OS: Windows XP
Subcategory: General
Tags: VB 2008, Inerits, VB help
Comment:

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"



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: August 23, 2009 at 16:10:29 Pacific
Reply:

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).


0

Response Number 2
Name: JJ_grant1220
Date: August 23, 2009 at 17:07:59 Pacific
Reply:

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?


0

Response Number 3
Name: Razor2.3
Date: August 23, 2009 at 18:00:17 Pacific
Reply:

It's looking for the "Dim DateInterval As Integer = 7" line and not finding it.


0

Response Number 4
Name: JJ_grant1220
Date: August 23, 2009 at 18:03:43 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Renaming a directory of f... Simple Batch File



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: help with Inherits class

help with classes in c++ www.computing.net/answers/programming/help-with-classes-in-c/11749.html

Java: Help with test class www.computing.net/answers/programming/java-help-with-test-class/8833.html

Help with my C++ program www.computing.net/answers/programming/help-with-my-c-program/1813.html