Solved

CHANGING COLOR IN DBGRID OR MSFLEXGRI

Posted on 2002-06-17
5
141 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Controlling which port to download from 4 72
VBA loop through headers using value 3 57
Search combo error "Data Type Mismatch in Criteria Expression" 2 53
Hide vba in gp 7 83
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

861 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now