Solved

Flexgrid font color per column

Posted on 2000-04-27
6
694 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
[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
  • 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

736 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