VB.Net equivalent for VB6 code

  • Thread starter Thread starter Colin McGuire
  • Start date Start date
C

Colin McGuire

Hi, in VB6 there was an event, for a form named Form1, to trap the
load event called Form1_Load. Similar events for Form1_Initialize and
Form1_Activate.

VB6 VB.Net
===================================
Form1_Load Handles MyBase.Load
Form1_Initialize Handles MyBase.Initialize
Form1_Activate ?

In VB.Net I have found that the first two events can be captured by
adding "Handles MyBase.Load" or "Handles MyBase.Initialize" to the
subroutine name.

I cannot find the equivalent routine for Form1_Activate. Is there one?

Thank you
Colin
 
Colin McGuire said:
Hi, in VB6 there was an event, for a form named Form1, to trap the
load event called Form1_Load. Similar events for Form1_Initialize
and Form1_Activate.

VB6 VB.Net
===================================
Form1_Load Handles MyBase.Load
Form1_Initialize Handles MyBase.Initialize
Form1_Activate ?

In VB.Net I have found that the first two events can be captured
by adding "Handles MyBase.Load" or "Handles MyBase.Initialize" to
the subroutine name.

You don't have to type it manually. Select them from the combobox at the top of the code editor window.
I cannot find the equivalent routine for Form1_Activate. Is there
one?

Intellisense deactivated?

Load => Load
Activate => Activated
Initialize => the constructor (sub New)


see also:
http://msdn.microsoft.com/library/en-us/vbcon/html/vxconChangesToFormObjectInVisualBasicNET.asp
 
* (e-mail address removed) (Colin McGuire) scripsit:
Hi, in VB6 there was an event, for a form named Form1, to trap the
load event called Form1_Load. Similar events for Form1_Initialize and
Form1_Activate.

VB6 VB.Net
===================================
Form1_Load Handles MyBase.Load
Form1_Initialize Handles MyBase.Initialize

There is no 'Initialize' event in VB.NET. I would compare 'Initialize'
to the ctor of the VB.NET class...
Form1_Activate ?
'Activated'.

In VB.Net I have found that the first two events can be captured by
adding "Handles MyBase.Load" or "Handles MyBase.Initialize" to the
subroutine name.

I cannot find the equivalent routine for Form1_Activate. Is there one?

'Activated'.
 
Back
Top