[program-l] Re: vb: load events

  • From: "David Lant" <david.lant1@xxxxxxxxxxxxxx>
  • To: <program-l@xxxxxxxxxxxxx>
  • Date: Mon, 26 Sep 2005 11:01:01 +0100

Hi Che,

I'll give you what should be a quick way to add this event procedure to your
code, and then give you the generic way of adding standard event procedures
to your code.

First, the quick method.  Open the form in the form designer, and make sure
that you have not selected any form controls.  I.e. the form itself is the
selected item.  Then, just press f7, to open the code window.  Normally, the
editor will open the code window to the default event procedure for the
selected control.  In this case, the form is the selected object, and the
usual default procedure for this is the Form_Load event.  Now, I don't
guarantee that this will work in VS 2005, partly because it's still in beta,
and partly because they may have changed their mind over this feature.

Now for the generic method.  If you open the code editor for your form, and
press ctrl+f2, this will put you in the drop-down list of objects known to
the current class module.  If you use the down arrow to see what's there,
you will find various different headings, including the form, overrides and
any controls that are on your form.  When you find the object whose events
you want to respond to, press enter and then tab once.  This then puts you
in a drop-down list of the events for the selected object.  Arrowing down
this list will show you all the existing events for which you can add an
event procedure.  When you find the event you want, press enter, and the
skeleton code will be added to your class, and the cursor placed inside it.

All the best,

David


-----Original Message-----
From: program-l-bounce@xxxxxxxxxxxxx [mailto:program-l-bounce@xxxxxxxxxxxxx]
On Behalf Of Che
Sent: 25 September 2005 04:07
To: program-l@xxxxxxxxxxxxx
Subject: [program-l] vb: load events


  I keep coming across references to the form load event while learning .net
programming, it says to select this froma drop down list, but I don't find
it anywhere.
  Is there a way to hard code this?  Or another place I can find it?  It
appears I needd to be doing my declarations there, but I can't find the darn
thing.
  Thanks for any help.
  Che

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: