V
Vittorio Pavesi
Hello,
is it possible to manually raise the event Elapsed of the timer object ?
Vittorio
is it possible to manually raise the event Elapsed of the timer object ?
Vittorio
* "Vittorio Pavesi said:is it possible to manually raise the event Elapsed of the timer object ?
* "Vittorio Pavesi said:Thank you for the workaround, this means that is not possible to raise that
kind of event ?
* "Cor Ligthert said:You can not raise the event however call the method, as with every event.
As parameters you can normaly always pass (Nothing, Nothing)
Herfried K. Wagner said:It simply doesn't make much sense IMO.
* "Vittorio Pavesi said:Really thanks for the explanation !
* "Cor Ligthert said:This time I do *not* disagree with you, however it is possible.
This would mean that the first action would be to disable the timer.
However it was to show that you could do this with almost every event.
(Although for that handler method it would be probably the same, I think it
is not right doing this for a timer and certainly not for another timer than
the forms.timer, however just my thought).
* "Cor Ligthert said:I find the fact not to do that for a timer more important than passing a
reference.
So passing the same parameters when I have them is something I would always
do, however giving false parameters is in my eyes even more confusing, than
is nothing even better because that is testable to nothing.
To give you an example, you know that I like it to make a collection of
controls and than to add handlers to it, when I not send always the standard
object I would have to do in those events.
If typeoff sender Is Button then
if directcast(sender, button).name = etc.
This can as well as
If Not sender is Nothing then etc.
So there is not much benefit in my opinion when the sender is not the
expected object.