Solved

CHANGING COLOR IN DBGRID OR MSFLEXGRI

Posted on 2002-06-17
5
147 Views
Last Modified: 2010-05-02
how can i change the color of the newly inputed data into the grid or change the color of the existing data in the grid. if i want the first data to be yello it will be yello and if i want the third data or row in the grid to be green it will be green. how can we do that?
0
Comment
Question by:therooster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 100 total points
ID: 7083598
Not using a DBGrid, is the simple answer.

The DBGrid is great for in-cell editing etc but doesn't support complex cell formatting, the flexgrid on the other hand supports the complex cell formatting but not the in-cell editing (though you can simulate this very effectively).

Using a flexgrid:

With MSFlexgrid1
  .Redraw = False
  .Col = 3
  .Row = 3
  .CellBackColor = vbBlue
  .CellForeColor = vbYellow
  .Col = 5
  .CellBackColor = vbRed
  .CellForeColor = vbWhite
  .Redraw = True
End With
0
 
LVL 1

Expert Comment

by:Benjy
ID: 7083867
TimCottee is right, but just a note:
if you want to color the entire row make the following changes:

With MSFlexgrid1
 .Redraw = False
 .FillStyle = flexfillrepeat
 .Row = 3
 .RowSel =3
 .Col = 0
 .ColSel = .Cols -1
 .CellBackColor = vbBlue
 .CellForeColor = vbYellow
 .Row = 5
 .RowSel = 5
 .Col = 0
 .ColSel = .Cols -1
 .CellBackColor = vbRed
 .CellForeColor = vbWhite
 .Redraw = True
End With
0
 

Author Comment

by:therooster
ID: 7088538
how about if the grid contains records.. and each records corresponds to a color scheme. so after data1.recordset.refresh the color will be back to normal.. is there another way? or an api functions of doing this?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7911076
Hi therooster,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept TimCottee's comment(s) as an answer.

therooster, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 7967650
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question