If you take a look in the Object Browser, you will find the
DataGridTextBoxColumn under the System.Windows. Forms heirarchy.
When you find the class, you will notice that it has three Paint methods.
All three Paint methods are Protected Overrides which means that they are
overriding from another superclass.
Each of these methods are overloaded in the DataGridTextBoxColumn Class.
However, they are not marked as Overridable which means you must implement
one of them as is. You are not providing any parameters to you call for
Paint in this sample code.
Take a look at the method signatures to see what is required for each
method.
--
Gerry O'Brien [MVP]
Visual Basic .NET(VB.NET)
"Jorge" <an*******@discussions.microsoft.com> wrote in message
news:07****************************@phx.gbl...
Hello
I am trying to change the backgroup color of windows form
datagrid. I found a sample class at the following URL
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnwinforms/html/wnf_CustDataGrid.asp
I get a compilation error sub 'Paint' cannot be
declared 'Overrides' because it does not override a sub
in a base class.
<code>
Public Class FormattableTextBoxColumn
Inherits DataGridTextBoxColumn
Public Event SetCellFormat As FormatCellEventHandler
Protected Overloads Overrides Sub Paint()
End Sub 'Paint
End Class
</code>
Does anyone know how to correct the compilation error or
has another class that does the same? Thanks
Kind Regards
Jorge Cavalheiro