Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Flexgrid font color per column

Posted on 2000-04-27
6
Medium Priority
?
701 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 43

Accepted Solution

by:
TimCottee earned 300 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

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
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…
Suggested Courses

730 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