Solved

Flexgrid font color per column

Posted on 2000-04-27
6
691 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
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.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

828 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