How to make a global event

2

I'm developing a system in which a user can send a message to another, (which gets saved in the database, to have a conversation history), but I would like that while the user is using other system functions , an event occurred and opened a window stating that it received a message.

I want to create a static class that will check for new messages. But how could I activate this event, and treat it?

EDIT

How many users will be logged into the system at the same time, would not there be some way for a trigger from the bank itself to send a signal to the system? Well, I'm afraid it will slow down the bank's speed if the timer stays open and closed.

    
asked by anonymous 07.05.2014 / 17:46

1 answer

1

You could add a Timer in the form that will display the messages and in the Tick event ask to check in the database if there is a new message. You could have in the table a column to tell whether the message was read or not, I indicate a boolean: 0 and 1 in the field and if it is true, it changes the form's text or something.

    
07.05.2014 / 18:11