Form.Load?

RacingDog

Active Member
Licensed User
I wanted to preselect a cell in a table. I put the code in App_Start. This caused an error dialog (see attachment (try Worpad or Word to read)) saying I couldn't do that and should move the code to the Form.Load event.

What Form.Load event?

In the designer, selecting the form and clicking on the Events menu option gives a drop down which does not include Load. Manually trying a sub "TheNameOfMyForm_Load" just gives me an uncalled sub.

Just in case the error text was inaccurate I tried looking for a method called Load instead, but....

In the code typing "TheNameOfMyForm." brings up a pop-up that does not include Load.

In the code typing "Form." brings up the same pop up.

Ignoring all that and typing a sub named "TheNameOfMyForm.Load" or "Form.Load" gives me a syntax error on the sub header line. Hardly, surprising, it just confirms the error report was correct in refering to an event. So that was a red herring.

The Help for Form also has no reference to a Load event.

I have another way of doing what I want, so no panic, but that still leaves the question...

What Form.Load???




Dang, I tried attaching a .rtf, then I tried a .doc for the error dialog, I can't see the attachment though. Oh well, just trust me then.
 
Last edited:

agraham

Expert
Licensed User
Longtime User
You haven't posted the attachment but the error you are getting is not a Basic4ppc error but a runtime .NET error. The Form Load event is not exposed by Basic4ppc so is not available. Your problem is that you can't select a cell in a Table until the Table is actually created which is not done until the Form is loaded which is done by Form.Show in Basic4ppc. Put your attempt at selection after the Form.Show in App_Start and it should work.
 

RacingDog

Active Member
Licensed User
Thanks for that.

It didn't seem to help being actually in App_Start but after the .Show call, but just doing it after that sub had completed worked. If you have a Tab control then the selection event is a useful place to do this, if necessary with a first time through flag, (just in case anybody else was wondering).

And sorry. I was severely pressed for time yesterday, but today is easier and I see I have inadvertantly duplicated a previous thread. Grovel, mia culpa.
 
Top