Tim
Tue Apr 05 17:15:14 CDT 2005
Just as FYI, if you post to the official Compact Framework newsgroup
(microsoft.public.dotnet.framework.compactframework) you'll usually get a
quicker reply.
--
Tim Wilson
.Net Compact Framework MVP
"Eve" <Eve@discussions.microsoft.com> wrote in message
news:8EAA5CC5-6004-4661-8588-47F742685E5C@microsoft.com...
> Yes, it works! I'm so grateful! Thank you so much!
>
> "Tim Wilson" wrote:
>
> > The following code works.
> >
> > Public Shared Sub SetGridBackColor(ByVal dg As DataGrid, ByVal clr As
Color)
> >
> > Dim oRenderer As Object = dg.GetType().GetField("m_renderer",
> > BindingFlags.NonPublic Or BindingFlags.Instance).GetValue(dg)
> >
> > oRenderer.GetType().GetField("m_brushEmptyBack",
BindingFlags.NonPublic Or
> > BindingFlags.Instance).SetValue(oRenderer, New SolidBrush(clr))
> >
> > dg.Invalidate()
> >
> > End Sub
> >
> > --
> > Tim Wilson
> > ..Net Compact Framework MVP
> >
> > "Eve" <Eve@discussions.microsoft.com> wrote in message
> > news:A44A21A1-5A9F-4A3B-A7A1-8FB835D757AB@microsoft.com...
> > > I'm getting this error:
> > > "'DataGrid' is a type and cannot be used as an expression",
> > > which is pointing to "Type.GetType(DataGrid)...."
> > >
> > > "Tim Wilson" wrote:
> > >
> > > > I haven't tested the code below, but it looks pretty good. I got
this
> > code
> > > > from the following translator. I modified it slightly.
> > > >
http://www.kamalpatel.net/ConvertCSharp2VB.aspx
> > > >
> > > > Imports System.Reflection
> > > >
> > > > Public Shared Sub SetGridBackColor(ByVal dg As DataGrid, ByVal clr
As
> > > > Color)
> > > > Dim oRenderer As Object =
> > Type.GetType(DataGrid).GetField("m_renderer",
> > > > BindingFlags.NonPublic Or BindingFlags.Instance).GetValue(dg)
> > > > oRenderer.GetType().GetField("m_brushEmptyBack",
> > BindingFlags.NonPublic Or
> > > > BindingFlags.Instance).SetValue(oRenderer, New SolidBrush(clr))
> > > > End Sub
> > > >
> > > > --
> > > > Tim Wilson
> > > > ..Net Compact Framework MVP
> > > >
> > > > "Eve" <Eve@discussions.microsoft.com> wrote in message
> > > > news:19C2742C-1026-4A3D-9A42-75723D3D7D7E@microsoft.com...
> > > > > Thanks for your help. I'm not sure how to translate it...
> > > > >
> > > > > "Tim Wilson" wrote:
> > > > >
> > > > > > Here's an example of how to do this. It's in C# but should be
easily
> > > > > > translated to VB.Net.
> > > > > >
http://opennetcf.org/Forums/topic.asp?TOPIC_ID=229
> > > > > >
> > > > > > --
> > > > > > Tim Wilson
> > > > > > ..Net Compact Framework MVP
> > > > > >
> > > > > > "Eve" <Eve@discussions.microsoft.com> wrote in message
> > > > > > news:758B3334-9A44-451B-A3F6-AD7163B5D61B@microsoft.com...
> > > > > > > I'm developing an application for Pocket PC in VB .NET. My
grid
> > can
> > > > > > contain
> > > > > > > up to 10 rows, but my table has only 2 and I see the dark gray
> > area.
> > > > Is
> > > > > > there
> > > > > > > a way to change the color of it? 'DataGrid1.BackgroundColor'
works
> > for
> > > > a
> > > > > > > Windows Application, but not Smart Device Application...
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >