Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

CHANGING COLOR IN DBGRID OR MSFLEXGRI

Posted on 2002-06-17
5
Medium Priority
?
151 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 400 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Suggested Courses

810 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