Wrox Programmer Forums
|
VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 16th, 2003, 05:13 AM
Ned Ned is offline
Authorized User
 
Join Date: Jun 2003
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default Overrides keyword

Hi everyone,
I have bought a new wrox book .NET Enterprise Development in VB.NET. When I build the first example it gives me error on the following sub routine declaration:

Public Overrides Sub Clear()
  ...
End sub

The error message is "Can not override 'Public Overrideable NotOverrideable Sub Clear()' because it is declared 'Notoverrideable'"

The same subroutine is defined in other module as

Public Sub Clear()
  ...
End sub

Any help is appreciated,

-ned
__________________
-Ned
 
Old September 16th, 2003, 02:29 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Ned,

When you create a Public method, by default it's "NotOverridable". You need to modify your base method with the "Overridable" keyword:

Public Overridable Sub Clear()
  ...
End sub

Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
The "New" Keyword rfarmer VB Components 1 August 16th, 2006 12:18 PM
New keyword Usage John Pennington Beginning VB 6 4 August 8th, 2006 10:39 PM
this keyword RSteel C# 1 December 18th, 2003 04:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.