?
Solved

CHANGING COLOR IN DBGRID OR MSFLEXGRI

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month9 days, 12 hours left to enroll

762 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