Results 1 to 6 of 6

Thread: Change DataGrid BackColor

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2016
    Posts
    753

    Change DataGrid BackColor

    Hello VbForums
    Is it possible to change the default backcolor of the datagrid control.
    I'm not referring to the rows but the unused part of the datagrid control.
    Thank you

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Change DataGrid BackColor

    As far as I know - no, not without subclassing and overriding the WM_PAINT events to draw it yourself.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2016
    Posts
    753

    Re: Change DataGrid BackColor

    Quote Originally Posted by LaVolpe View Post
    As far as I know - no, not without subclassing and overriding the WM_PAINT events to draw it yourself.
    Thank you
    I was almost sure that without subclassing this is not possible.
    I wonder if someone has got a sample.

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Change DataGrid BackColor

    From memory, when I've seen posts like this in the past, the most common answer was to use another grid control. However, many of those would suggest custom ownerdrawn controls like LynxGrid (PlanetSourceCode) and SGrid (I think that's from vbAccelerator), and others. Could be an option I suppose. I personally have used the datagrid and don't find its color scheme horrible and still professional looking. That's just my opinion though.

    I'd guess that the DataGrid may use the simple DrawFrameControl API which isn't theme aware AFAIK - hence the simple gray backcolor and row selector arrows as black.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2016
    Posts
    753

    Re: Change DataGrid BackColor

    Seems amusing this LynxGrid
    I'll give it a try.
    Thanks a lot

  6. #6
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: Change DataGrid BackColor

    I would use an mshflexgrid or Krool's VBFlexGrid which is still in active development --> http://www.vbforums.com/showthread.p...xGrid-control)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width