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
Solved

How can I make the Flexgrid control flash/blink

Posted on 2006-06-15
5
329 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

808 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