• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can we call one event frmo other

 
nabi bux
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we call one event frmo other as in vb
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing syntactically stops you from having one event handler method call another event handler method. (It makes no sense to talk about one event calling an another.) Whilst no one can stop you from coding this (well, maybe your team lead ) it might indicate that you are cutting corners. An event handler method is meant to *react* to an event; if one handler method is calling the other directly -- where is the second event? I would suggest either of the following instead:

1. Perhaps the first handler method should just cause the second *event* to occur, which would automatically lead to the second event handler being called in due time. For example, if the first event handler puts text into a text component, document listeners for that text component will be alerted.

2. Perhaps there is some common code in your second event handler that needs to be factored out and placed in a separate method. Then both handlers can invoke that code without calling each other.

I can't be more explicit unless you explain your context.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!