Solved

How can I make the Flexgrid control flash/blink

Posted on 2006-06-15
5
314 Views
Last Modified: 2008-02-01
I have an application that uses the flexgrid control to display an appointment schedule.  Each block may consist of a different background color.  I would like to have the background color blink or flash when an appointment has arrived to make it stand out on the schedule (the appointment checks in at a self-serve kiosk).  Can this be done with the MS flexgrid?  What code can be used to make it blink?
0
Comment
Question by:bc4942
  • 2
  • 2
5 Comments
 
LVL 26

Expert Comment

by:EDDYKT
Comment Utility
use timer
0
 

Author Comment

by:bc4942
Comment Utility
Would that not require I query the database of appointments every time the timer is fired to determine which cells should have the color changed?  That could make things pretty slow.
0
 
LVL 5

Expert Comment

by:lunchbyte
Comment Utility
NO, you do not have to query the database every time the timer elapsed. When you load the flexgrid with description of the appt and time, you use the timer that loops through the cells and check the time and date you have stored in it to decide which cell should be blinking. Each time the timer elapsed, change the cell color and scan the other cells for new cell to blink.

I hope I explain it well.

0
 

Author Comment

by:bc4942
Comment Utility
Okay, then how would I cycle through all of the cells?  My current code adds the cells from data in the database (column, row).
0
 
LVL 5

Accepted Solution

by:
lunchbyte earned 250 total points
Comment Utility
Drop a timer on your form and double click it. Set the timer 2 or 3 second by setting it to 2000 or 3000.

I do not know what your grid is setup like but this should give you an idea.

Private Sub Timer1_Timer()
    Dim i As Long, x As Long
   
    For i = 0 To grd.Rows
        For x = 0 To grd.Cols
           
            If grd.TextMatrix(i, x) > Now Then
                If grd.Cell(flexcpBackColor, i, x) = vbRed Then
                    grd.Cell(flexcpBackColor, i, x) = vbWhite
                Else
                    grd.Cell(flexcpBackColor, i, x) = vbRed
                End If
            End If
           
        Next x
    Next i

End Sub
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

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.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now