5 Replies - 3163 Views - Last Post: 07 September 2009 - 10:27 PM Rate Topic: -----

#1 weirddemon  Icon User is offline

  • D.I.C Head

Reputation: -2
  • View blog
  • Posts: 190
  • Joined: 05-January 09

Running Tasks on Form's Load Event

Posted 07 September 2009 - 12:10 PM

I have two forms. On form one, I have a serious of check boxes and in form two I have functions relating to those check boxes.

When the second form loads, I check the Checked State of the Check Boxes, and run the appropriate functions.

This is working just fine. The problem I have, is that the second form doesn't show until the functions that have been selected have completed.

It would be ideal if the form would load and then run the functions.

I don't think that I could have everything run on startup, but hopefully there is another method.

I know I could load the second form and then just run the code in the previous form, but this is less than ideal, because I can't show the second form as .ShowDialog and I want to be able to split up the code into the other form so that it's not so crowded and easier to read on the first one.

Any info you all can provide would be helpful,

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Running Tasks on Form's Load Event

#2 Jay93  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 93
  • Joined: 04-August 09

Re: Running Tasks on Form's Load Event

Posted 07 September 2009 - 01:44 PM

Could you do the form2 load method, to run the functions, then once they have completed set form2.visible to true?
Was This Post Helpful? 1
  • +
  • -

#3 mark.bottomley  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 176
  • View blog
  • Posts: 990
  • Joined: 22-April 09

Re: Running Tasks on Form's Load Event

Posted 07 September 2009 - 02:12 PM

Other choices would include .Activated and .Resized as events that occur after Load. You can experiment with calling the code in those events.
Was This Post Helpful? 1
  • +
  • -

#4 weirddemon  Icon User is offline

  • D.I.C Head

Reputation: -2
  • View blog
  • Posts: 190
  • Joined: 05-January 09

Re: Running Tasks on Form's Load Event

Posted 07 September 2009 - 05:04 PM

Quote

Could you do the form2 load method, to run the functions, then once they have completed set form2.visible to true?


That's pretty much once happening now. I want Form 2 to run the functions, but show the form first.

Quote

Other choices would include .Activated and .Resized as events that occur after Load. You can experiment with calling the code in those events.


I'll look into those.

Thanks so far.
Was This Post Helpful? 0
  • +
  • -

#5 CakeMaker  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 69
  • Joined: 20-August 09

Re: Running Tasks on Form's Load Event

Posted 07 September 2009 - 10:16 PM

I have a program where I have checkboxes on the first form, then the values in textboxes on a second form. I can call the .text values of each textbox on form 2 without even making it visible.

I'm just wondering if you can do the same thing with your functions?


'Return the function from the other form.
myForm2.myFunction()



Nevermind...I misread the initial post and was thinking that you wanted to just call the functions...sorry :(

This post has been edited by CakeMaker: 07 September 2009 - 10:20 PM

Was This Post Helpful? 1
  • +
  • -

#6 weirddemon  Icon User is offline

  • D.I.C Head

Reputation: -2
  • View blog
  • Posts: 190
  • Joined: 05-January 09

Re: Running Tasks on Form's Load Event

Posted 07 September 2009 - 10:27 PM

Quote

Nevermind...I misread the initial post and was thinking that you wanted to just call the functions...sorry


No worries.

I ended up using the activated property and it works great.

Thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1