Me vs MyBase

Sani Love 160 Reputation points
2023-05-06T15:43:32.3066667+00:00

Hello

In visual basic .net 2010, using .net framework 4.0, I noticed that some of my forms have Handles MyBase.Load while some others have Handles Me.Load as the form load handler defined.

Since this is inserted by the vs designer itself, why difference?

Which one is recommended so I update all my forms for handler of these events:

From Load

Form FormClosing

Form HelpRequested

Thank you all

Developer technologies | VB
0 comments No comments
{count} votes

Accepted answer
  1. Karen Payne MVP 35,586 Reputation points Volunteer Moderator
    2023-05-06T16:57:04.38+00:00

    See the docs

    Me, My, MyBase, and MyClass in Visual Basic

    Also, use Form.Shown rather than Form.Load as there are time when the Load event swallows unhanded exceptions.

    The other events you should know when to use them e.g. Closing and HelpRequested.


1 additional answer

Sort by: Most helpful
  1. Castorix31 90,686 Reputation points
    2023-05-06T16:58:11.8766667+00:00

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.