Solved

How can I make the Flexgrid control flash/blink

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

815 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