?
Solved

How can I make the Flexgrid control flash/blink

Posted on 2006-06-15
5
Medium Priority
?
347 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
[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
  • 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 1000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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.
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…
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…
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

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