Solved

How can I make the Flexgrid control flash/blink

Posted on 2006-06-15
5
318 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
ID: 16913771
use timer
0
 

Author Comment

by:bc4942
ID: 16913805
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
ID: 16913943
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
ID: 16914100
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
ID: 16914153
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

920 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

15 Experts available now in Live!

Get 1:1 Help Now