473,471 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Overridable problem

Why can't I add the 'Overridable' key word to any of the methods
or events in my base class? VB.NET thinks I am trying to define a
variable. What am I doing wrong?

I get the squiggly line under most of the method and the error reads
"Option Strict On requires all vaiable declarations to have an
'AS' clause"

Example code 1:

Protected Overrideable Sub SaveRecord()
' stuff to save a record
End Sub

Example code 2:

Protected Overrideable Sub DataGrid1_MouseUp(ByVal sender As
Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles
DataGrid1.MouseUp
'Highlight the entire row
'Get the X and Y of the DataGrid from the mouse event
Dim pt As New Point(e.X, e.Y)
Dim hti As DataGrid.HitTestInfo = Me.DataGrid1.HitTest(pt)

If hti.Type = DataGrid.HitTestType.Cell Then
'Me.DataGrid1.CurrentCell = New DataGridCell(hti.Row, hti.Column)
Me.DataGrid1.Select(hti.Row)
End If
End Sub

Please help.

-Doug

Nov 21 '05 #1
3 2305
Doug,

In order to use the Overridable keyword you need to spell it correctly in
your code.

Kerry Moorman
"dbuchanan" wrote:
Why can't I add the 'Overridable' key word to any of the methods
or events in my base class? VB.NET thinks I am trying to define a
variable. What am I doing wrong?

I get the squiggly line under most of the method and the error reads
"Option Strict On requires all vaiable declarations to have an
'AS' clause"

Example code 1:

Protected Overrideable Sub SaveRecord()
' stuff to save a record
End Sub

Example code 2:

Protected Overrideable Sub DataGrid1_MouseUp(ByVal sender As
Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles
DataGrid1.MouseUp
'Highlight the entire row
'Get the X and Y of the DataGrid from the mouse event
Dim pt As New Point(e.X, e.Y)
Dim hti As DataGrid.HitTestInfo = Me.DataGrid1.HitTest(pt)

If hti.Type = DataGrid.HitTestType.Cell Then
'Me.DataGrid1.CurrentCell = New DataGridCell(hti.Row, hti.Column)
Me.DataGrid1.Select(hti.Row)
End If
End Sub

Please help.

-Doug

Nov 21 '05 #2
"dbuchanan" <db*********@hotmail.com> schrieb:
Why can't I add the 'Overridable' key word to any of the methods
or events in my base class? VB.NET thinks I am trying to define a
variable. What am I doing wrong?

I get the squiggly line under most of the method and the error reads
"Option Strict On requires all vaiable declarations to have an
'AS' clause"

Example code 1:

Protected Overrideable Sub SaveRecord()


The keyword's name is 'Overridable', not 'Overrideable'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3
Thank you

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Marina | last post by:
Hi, I have a class that inherits from CollectionBase, and I'm trying to override its Count property. As per the documentation, this property is overridable - so I should be able to do this. So...
2
by: H | last post by:
Here is a good one!! A book I am reading on OOP states 'If any method is marked to allow overriding, the access can be changed by a derived class.' Also 'A derived class can even change...
1
by: bminder | last post by:
In the asp.net pages below, Common.vb has an overridable Page_Load sub. In the consuming page, Two.aspx, the Page_Load sub is inherited, but for some reason it (Overrides Sub Page_Load) executes...
1
by: steve kain | last post by:
Hi. I'm just wondering how come the compiler complains when you declare a new sub as overridable but it then lets you define multiple new subs with different interfaces, essentially overriding...
2
by: MDFS | last post by:
Hi, I was wondering if anyone has any information on the performance impact of using functions declared as overridable? To Explain more fully; By default every function created in VB is NOT...
3
by: grawsha2000 | last post by:
Hello, I have an overridable function in a base class (to do some basic database works) that gets inherited by many concrete classes. These concrete classes expands the work of that...
5
by: Ben | last post by:
Hi, i defined a function in the base class 'ford' and the same function (with different output) in subclass "peugeot". I first put 'Overridable function' in the base class and 'Overrides...
3
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I'm learning about overriding. My understanding is that I can override methods and properties of a class by inheriting that class. Does it include attribute?
0
by: Internet User | last post by:
According to MSDN, You should never base the security of your application on a member that is marked with the internal virtual modifier in C# (the Overloads Overridable Friend modifier in Visual...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.