VB.Net equivalent for VB6 code

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
 
A

Armin Zingler

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
 
H

Herfried K. Wagner [MVP]

* (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'.
 

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

Top