How delay firing of a code?

  • Thread starter Thread starter Woody Splawn
  • Start date Start date
W

Woody Splawn

Is there a way in vb.net to delay the firing of certain code till after
everything else has run?

That is, I have an event with some code in it that needs to run AFTER
everything else has run when the form is loaded. Is there a mechanism in
vb.net that will allow the call of an event only after everthing else has
fired and run?
 
Hi,

The activate event fires after the load event maybe that will work
better for you.

Ken
----------------
Is there a way in vb.net to delay the firing of certain code till after
everything else has run?

That is, I have an event with some code in it that needs to run AFTER
everything else has run when the form is loaded. Is there a mechanism in
vb.net that will allow the call of an event only after everthing else has
fired and run?
 
What are you trying to wait for? Usually doing stuff in the form.load event
is sufficent for most things. You could do things at the end Sub New
function as well.

Chris
 
Based on its name I would think the activate event would fire before
everything else. Does it instead fire after everything else?

Is there a list or knowledgebase article somewhere that tells what events
fire and in what order?
 
Thank you for poiting me to the article. I am thinking about it.

This does not address the original question however. The question is
whether there is a mechanism in VB.net that will delay the firing of a piece
of code untill all other events have been fired. Is there?

It maybe that I am trying to get one piece of software to act like another
but in the Sybase environment, where I came from, sucfh a mechanism is
common.
 
Woody,

I think that we don't understand your problem. For sure that is for me.

The events are fired logical after each other, not in the same time.

The closed event is after the closing event
The activated event is after the load event

On this page is written when they occurs
http://msdn.microsoft.com/library/d...ml/frlrfSystemWindowsFormsFormEventsTopic.asp

However this is not forever clear. Therefore you can maybe see this page.
http://msdn.microsoft.com/library/d.../vbcon/html/vbconwindowsformsarchitecture.asp

It can be that you change inside an event something what fires itself an
event, that is what I call a hell because that is directly done, while you
don't want to do that.

By instance setting a new index inside an indexchange event fires that,
while you probably don't like that. My solution is than to remove the
handler in advance.

However maybe you can clearify more to us by telling us in what situation
you want to delay firing, because in fact they fire all sequential and some
cannot fire before the other is ready.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top