By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 1,015 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

Overridable problem

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
"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

P: n/a
Thank you

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.