Hi,
In the paint procedure I use the brushes sent it to draw. You can
replace the foreBrush and backBrush with what ever you want to customize its
look. Have fun with it.
Protected Overloads Overrides Sub Paint(ByVal g As System.Drawing.Graphics,
ByVal bounds As System.Drawing.Rectangle, ByVal source As
System.Windows.Forms.CurrencyManager, ByVal rowNum As Integer, ByVal
backBrush As System.Drawing.Brush, ByVal foreBrush As System.Drawing.Brush,
ByVal alignToRight As Boolean)
'clear the cell
g.FillRectangle(backBrush, bounds) ' Could try g.FillRectangle(Brushes.Gray,
bounds)
'draw the value
Dim s As String = Me.GetColumnValueAtRow([source], rowNum).ToString()
Dim r As Rectangle = bounds
r.Inflate(0, -1)
g.DrawString(s, MyBase.TextBox.Font, foreBrush, RectangleF.op_Implicit(r), _
mDrawTxt)
End Sub
Here is a link to some more examples of column styles.
http://www.onteorasoftware.com/downl...redcolumns.zip
Ken
------------------------
"John Smith" <so*****@microsoft.com> wrote in message
news:1fjae.1109512$8l.266337@pd7tw1no...
Hi All;
I am using the HeaderAndDataAlignColumn class from Ken Tucker. I have
customized it for a wider row. I reposition the DrawString method so the
text is centered vertically in the row.
My problem now is that on ReadOnly cells the shaded background is not at the
top of the cell. I adjust the rectangle Height so that the shading does not
drop into the next row.
Is there an override that I can write to reposition the shaded background?
Thanks.