Solved

Flexgrid font color per column

Posted on 2000-04-27
6
685 Views
Last Modified: 2013-12-02
Is it possible to set the font color per column in a flexgrid? Or maybe even let the characters be transparent?
0
Comment
Question by:mawe
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:Marine
ID: 2755443
I don't know about the charecters being transparent but its very easy to set the font color of a cpecific row or a cell in that row to a different color. Here is the example. It sets every other row to another color.I took this from my project so it uses database to populate it. It sets every other row to a specific color. Also if the value in one of my Cells was less then a specific date it would set the color of that cell to another color. If you won't understand something ask. Anyhow you have to use CellBackcolor and CellForecolor properties to set the backcolor and forecolor of the cell to another color. Best of luck.

Do Until rsUser.EOF
         I = I + 1: .Row = I
         J = -1
         For Each fld In rsUser.Fields
             DoEvents       'Process Other Events
             J = J + 1
             If .Row Mod 2 Then
                .Col = J: .CellBackColor = vbGreen
             Else
                .Col = J: .CellBackColor = vbWhite
             End If
             If J = 4 And rsUser!Returned = "False" Then
                If Date > CDate(fld) Then
                   .Col = J
                   .CellForeColor = vbRed: .CellBackColor = vbYellow
                End If
             Else
                    .Col = J: .CellForeColor = vbBlack
             End If
             .TextMatrix(I, J) = fld
         Next fld
         IBar.CurrRecord = I
         rsUser.MoveNext
Loop
0
 
LVL 6

Expert Comment

by:Marine
ID: 2755448
take away IBar.CurrRecord away from the code.
0
 

Author Comment

by:mawe
ID: 2755517
Ok, let me refrase. I need some of by columns in my flexgrid to be invisible to the viewer. My first thought was to set the fore- and back color to the same value. However, setting individual columns as unvisible would be a lot better. So how do I do that? There is a method called ColIsVisible which returns a boolean so it should be possible!
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 43

Accepted Solution

by:
TimCottee earned 100 total points
ID: 2755672
mawe:

The .ColIsVisible property relates to whether the column is in the visible area of the grid, not to the left or right of the columns you can see.

The easiest way to hide a column would be to set its width to 0;

MSFlexGrid1.ColWidth(3) = 0

for example.
0
 

Author Comment

by:mawe
ID: 2758187
Ok, let me refrase. I need some of by columns in my flexgrid to be invisible to the viewer. My first thought was to set the fore- and back color to the same value. However, setting individual columns as unvisible would be a lot better. So how do I do that? There is a method called ColIsVisible which returns a boolean so it should be possible!
0
 

Author Comment

by:mawe
ID: 2758193
Thanks Tim, that works fine by me!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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.
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

746 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

11 Experts available now in Live!

Get 1:1 Help Now